Skip to content

Commit

Permalink
improve multi Y init timing
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Chevalier committed Mar 13, 2017
1 parent d1fb91d commit 412e00f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 26 deletions.
6 changes: 4 additions & 2 deletions dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,11 @@ <h2>Example of a timeseries with a custom series configuration</h2>
<br />
<br />
<h2>Example of a timeseries with a additional d3 rectangle drawn on top</h2>
<div style="width: 800px; height:800px; background-color: salmon">
<px-vis-timeseries
id="chartCustom"
height="500"
width="800"
height="300"
width="400"
prevent-resize
register-config='{
"width": 250
Expand All @@ -363,6 +364,7 @@ <h2>Example of a timeseries with a additional d3 rectangle drawn on top</h2>
"title": "Temperature"
}'
></px-vis-timeseries>
</div>
</template>
<script>
window.addEventListener('WebComponentsReady', function() {
Expand Down
50 changes: 32 additions & 18 deletions dev_add.html

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions px-vis-timeseries.html
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,10 @@
value: { top: 5, right: 5, bottom: 5, left: 5},
},
_internalMargin: {
type: Object,
notify: true
type: Object
},
_internalMarginNav: {
type:Object,
notify: true
type:Object
},
/**
* Configuration object for the chart. Key is the property name.
Expand Down Expand Up @@ -616,7 +614,8 @@
'_registerConfigChanged(registerConfig.*)',
'_toolbarConfigChanged(toolbarConfig.*)',

'_calcAxes(completeSeriesConfig.*, leftAxisSize, rightAxisSize)',
'_calcAxes(completeSeriesConfig.*)',
'_calcAxes(leftAxisSize, rightAxisSize)',
'_calcMargins(margin.*, marginNav.*, numRightAxes, numLeftAxes)',
'_setXScale(width, _internalMargin, xAxisType)',
'_setMultiYScale(height, _internalMargin, axes.*)',
Expand Down Expand Up @@ -645,7 +644,6 @@
if(this.xAxisType !== 'time' && this.xAxisType !== 'timeLocal') { this.set('xAxisType', 'time'); }
if(!this.yAxisType) { this.set('yAxisType', 'linear'); }

this._calcMargins();
this._isReady = true;
},

Expand Down Expand Up @@ -705,6 +703,7 @@
*/
_calcMargins:function() {
this.debounce('_calcMargin', function() {

var margin,
marginNav,
topMargin = 25,
Expand Down

0 comments on commit 412e00f

Please sign in to comment.