Skip to content

Commit 41cc084

Browse files
author
Niilo Keinänen
committed
LCJS v7.0.1
1 parent 460b494 commit 41cc084

8 files changed

+15
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
5656
© LightningChart Ltd 2009-2022. All rights reserved.
5757

5858

59-
[Data Grid]: https://lightningchart.com/js-charts/api-documentation/v6.1.0/classes/DataGrid.html
60-
[Chart XY]: https://lightningchart.com/js-charts/api-documentation/v6.1.0/classes/ChartXY.html
59+
[Data Grid]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/classes/DataGrid.html
60+
[Chart XY]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/classes/ChartXY.html
6161

-3.21 KB
Loading
-8.61 KB
Loading

dataGridMonitoringHeatmap-light.png

-15.9 KB
Loading
-11.9 KB
Loading
-767 Bytes
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"webpack-stream": "^7.0.0"
1818
},
1919
"dependencies": {
20-
"@lightningchart/lcjs": "^6.1.1",
20+
"@lightningchart/lcjs": "^6.1.2",
2121
"@lightningchart/xydata": "^1.4.0"
2222
},
2323
"lightningChart": {

src/index.js

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const {
1010
LegendBoxBuilders,
1111
UIElementBuilders,
1212
UIOrigins,
13+
emptyFill,
1314
Themes,
1415
} = lcjs
1516
const { createProgressiveTraceGenerator } = xydata
@@ -28,15 +29,10 @@ const exampleTrends = [
2829
const exampleTrendsCount = exampleTrends.length
2930
const exampleDataCount = 50 * 1000
3031

31-
let license = undefined
32-
try {
33-
license = LCJS_LICENSE
34-
} catch (e) {}
35-
3632
// NOTE: Using `Dashboard` is no longer recommended for new applications. Find latest recommendations here: https://lightningchart.com/js-charts/docs/basic-topics/grouping-charts/
3733
const dashboard = lightningChart({
38-
license: license,
39-
})
34+
resourcesBaseUrl: new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'resources/',
35+
})
4036
.Dashboard({
4137
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
4238
numberOfColumns: 1,
@@ -53,8 +49,9 @@ const dataGrid = dashboard
5349

5450
const seriesXYList = exampleTrends.map((trend) =>
5551
chartXY
56-
.addLineSeries({ dataPattern: { pattern: 'ProgressiveX' } })
57-
.setDataCleaning({ minDataPointCount: 1 })
52+
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
53+
.setAreaFillStyle(emptyFill)
54+
.setMaxSampleCount(50_000)
5855
.setName(trend.name),
5956
)
6057
const axisX = chartXY
@@ -67,20 +64,17 @@ const axisXTop = chartXY
6764
.addAxisX({ opposite: true })
6865
.setTickStrategy(AxisTickStrategies.Empty)
6966
.setStrokeStyle(emptyLine)
70-
.setMouseInteractions(false)
67+
.setPointerEvents(false)
7168
synchronizeAxisIntervals(axisX, axisXTop)
7269
const indicator15s = axisXTop.addCustomTick(UIElementBuilders.AxisTickMajor).setTextFormatter((_) => '-15 s')
7370

74-
const legend = chartXY
75-
.addLegendBox(LegendBoxBuilders.HorizontalLegendBox, { x: chartXY.getDefaultAxisX(), y: chartXY.getDefaultAxisY() })
76-
.add(chartXY)
77-
const positionLegend = () => {
71+
const legend = chartXY.addLegendBox(LegendBoxBuilders.HorizontalLegendBox, chartXY.coordsRelative).add(chartXY)
72+
chartXY.addEventListener('layoutchange', (event) => {
7873
legend.setOrigin(UIOrigins.CenterBottom).setPosition({
79-
x: (chartXY.getDefaultAxisX().getInterval().start + chartXY.getDefaultAxisX().getInterval().end) / 2,
80-
y: chartXY.getDefaultAxisY().getInterval().start,
74+
x: event.margins.left + event.viewportWidth / 2,
75+
y: event.margins.bottom,
8176
})
82-
}
83-
chartXY.forEachAxis((axis) => axis.onIntervalChange(positionLegend))
77+
})
8478

8579
const theme = dashboard.getTheme()
8680
const textFillGood = theme.examples.positiveTextFillStyle

0 commit comments

Comments
 (0)