|
1 | 1 | const lcjs = require('@lightningchart/lcjs') |
2 | 2 | const xydata = require('@lightningchart/xydata') |
3 | 3 |
|
4 | | -const { AxisScrollStrategies, AxisTickStrategies, lightningChart, LegendBoxBuilders, Themes } = lcjs |
| 4 | +const { AxisScrollStrategies, AxisTickStrategies, lightningChart, LegendBoxBuilders, emptyFill, Themes } = lcjs |
5 | 5 | const { createProgressiveTraceGenerator } = xydata |
6 | 6 |
|
7 | | -let license = undefined |
8 | | -try { |
9 | | - license = LCJS_LICENSE |
10 | | -} catch (e) {} |
11 | | - |
12 | 7 | // NOTE: Using `Dashboard` is no longer recommended for new applications. Find latest recommendations here: https://lightningchart.com/js-charts/docs/basic-topics/grouping-charts/ |
13 | 8 | const dashboard = lightningChart({ |
14 | | - license: license, |
15 | | -}).Dashboard({ |
| 9 | + resourcesBaseUrl: new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'resources/', |
| 10 | + }).Dashboard({ |
16 | 11 | theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined, |
17 | 12 | numberOfRows: 1, |
18 | 13 | numberOfColumns: 2, |
@@ -42,23 +37,21 @@ chartXY |
42 | 37 | .setAnimationScroll(false) |
43 | 38 |
|
44 | 39 | const seriesSMA = chartXY |
45 | | - .addLineSeries({ |
46 | | - dataPattern: { |
47 | | - pattern: 'ProgressiveX', |
48 | | - }, |
| 40 | + .addPointLineAreaSeries({ |
| 41 | + dataPattern: 'ProgressiveX', |
49 | 42 | automaticColorIndex: 3, |
50 | 43 | }) |
51 | | - .setDataCleaning({ minDataPointCount: 1 }) |
| 44 | + .setAreaFillStyle(emptyFill) |
| 45 | + .setMaxSampleCount(10_000) |
52 | 46 | .setName('Moving average') |
53 | 47 |
|
54 | 48 | const seriesValue = chartXY |
55 | | - .addLineSeries({ |
56 | | - dataPattern: { |
57 | | - pattern: 'ProgressiveX', |
58 | | - }, |
| 49 | + .addPointLineAreaSeries({ |
| 50 | + dataPattern: 'ProgressiveX', |
59 | 51 | automaticColorIndex: 0, |
60 | 52 | }) |
61 | | - .setDataCleaning({ minDataPointCount: 1 }) |
| 53 | + .setAreaFillStyle(emptyFill) |
| 54 | + .setMaxSampleCount(10_000) |
62 | 55 | .setName('Value') |
63 | 56 |
|
64 | 57 | const legend = chartXY.addLegendBox(LegendBoxBuilders.HorizontalLegendBox).add(chartXY) |
|
0 commit comments