@@ -8,7 +8,7 @@ const lcjs = require('@lightningchart/lcjs')
8
8
const xydata = require ( '@lightningchart/xydata' )
9
9
10
10
// Extract required parts from LightningChartJS.
11
- const { lightningChart, Themes } = lcjs
11
+ const { lightningChart, Themes, emptyFill } = lcjs
12
12
13
13
// Import data-generator from 'xydata'-library.
14
14
const { createProgressiveTraceGenerator } = xydata
@@ -21,14 +21,12 @@ const chart = lightningChart({
21
21
} )
22
22
23
23
// Create line series optimized for regular progressive X data.
24
- const series = chart . addLineSeries ( {
25
- dataPattern : {
24
+ const series = chart
25
+ . addPointLineAreaSeries ( {
26
26
// pattern: 'ProgressiveX' => Each consecutive data point has increased X coordinate.
27
- pattern : 'ProgressiveX' ,
28
- // regularProgressiveStep: true => The X step between each consecutive data point is regular (for example, always `1.0`).
29
- regularProgressiveStep : true ,
30
- } ,
31
- } )
27
+ dataPattern : 'ProgressiveX' ,
28
+ } )
29
+ . setAreaFillStyle ( emptyFill )
32
30
33
31
// Generate traced points stream using 'xydata'-library.
34
32
chart . setTitle ( 'Generating test data...' )
@@ -43,7 +41,7 @@ createProgressiveTraceGenerator()
43
41
const addPoints = ( ) => {
44
42
const addDataPointsCount = 20000
45
43
const newDataPoints = data . slice ( dataPointsCount , dataPointsCount + addDataPointsCount )
46
- series . add ( newDataPoints )
44
+ series . appendJSON ( newDataPoints )
47
45
dataPointsCount += addDataPointsCount
48
46
if ( dataPointsCount < dataLen ) {
49
47
requestAnimationFrame ( addPoints )
0 commit comments