@@ -8,7 +8,7 @@ const lcjs = require('@lightningchart/lcjs')
88const xydata = require ( '@lightningchart/xydata' )
99
1010// Extract required parts from LightningChartJS.
11- const { lightningChart, AxisScrollStrategies, Themes } = lcjs
11+ const { lightningChart, AxisScrollStrategies, emptyFill , Themes } = lcjs
1212
1313// Import data-generators from 'xydata'-library.
1414const { createSampledDataGenerator } = xydata
@@ -24,18 +24,12 @@ const chart = lightningChart({
2424
2525// Create line series optimized for regular progressive X data.
2626const series = chart
27- . addLineSeries ( {
28- dataPattern : {
29- // pattern: 'ProgressiveX' => Each consecutive data point has increased X coordinate.
30- pattern : 'ProgressiveX' ,
31- // regularProgressiveStep: true => The X step between each consecutive data point is regular (for example, always `1.0`).
32- regularProgressiveStep : true ,
33- } ,
27+ . addPointLineAreaSeries ( {
28+ dataPattern : 'ProgressiveX' ,
3429 } )
3530 . setName ( )
36- // Destroy automatically outscrolled data (old data becoming out of scrolling axis range).
37- // Actual data cleaning can happen at any convenient time (not necessarily immediately when data goes out of range).
38- . setDataCleaning ( { minDataPointCount : 10000 } )
31+ . setMaxSampleCount ( 100_000 )
32+ . setAreaFillStyle ( emptyFill )
3933
4034// Setup view nicely.
4135chart
@@ -1651,5 +1645,5 @@ createSampledDataGenerator(point, 1, 10)
16511645 . toStream ( )
16521646 . forEach ( ( point ) => {
16531647 // Push the created points to the series.
1654- series . add ( { x : point . timestamp , y : point . data . y } )
1648+ series . appendSample ( { x : point . timestamp , y : point . data . y } )
16551649 } )
0 commit comments