@@ -11,6 +11,7 @@ const chart = lightningChart({
1111 resourcesBaseUrl : new URL ( document . head . baseURI ) . origin + new URL ( document . head . baseURI ) . pathname + 'resources/' ,
1212 } )
1313 . ChartXY ( {
14+ legend : { visible : false } ,
1415 defaultAxisX : {
1516 type : 'linear-highPrecision' ,
1617 } ,
@@ -22,34 +23,17 @@ const axisX = chart.getDefaultAxisX().setTickStrategy(AxisTickStrategies.Time, (
2223
2324const axisY = chart . getDefaultAxisY ( )
2425
25- const trace0 = chart
26- . addPointLineAreaSeries ( {
27- dataPattern : 'ProgressiveX' ,
28- } )
29- . setAreaFillStyle ( emptyFill )
30-
31- const trace1 = chart
32- . addPointLineAreaSeries ( {
33- dataPattern : 'ProgressiveX' ,
34- } )
35- . setAreaFillStyle ( emptyFill )
26+ const trace0 = chart . addLineSeries ( )
3627
37- chart
38- . addLegendBox ( )
39- . add ( chart )
40- // Dispose example UI elements automatically if they take too much space. This is to avoid bad UI on mobile / etc. devices.
41- . setAutoDispose ( {
42- type : 'max-width' ,
43- maxWidth : 0.3 ,
44- } )
28+ const trace1 = chart . addLineSeries ( )
4529
4630// Fetch example data.
4731fetch ( new URL ( document . head . baseURI ) . origin + new URL ( document . head . baseURI ) . pathname + 'examples/assets/0014/data.json' )
4832 . then ( ( r ) => r . json ( ) )
4933 . then ( ( data ) => {
5034 // Data X coordinates are in milliseconds starting from 0.
51- trace0 . add ( data [ 'trace0' ] )
52- trace1 . add ( data [ 'trace1' ] )
35+ trace0 . appendJSON ( data [ 'trace0' ] )
36+ trace1 . appendJSON ( data [ 'trace1' ] )
5337 axisX . fit ( false )
5438
5539 // Animate zoom in.
0 commit comments