Skip to content

Commit 7e92f78

Browse files
author
Niilo Keinänen
committed
v6.0.0
1 parent a739a25 commit 7e92f78

File tree

4 files changed

+78
-99
lines changed

4 files changed

+78
-99
lines changed

README.md

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

5656

57-
[Dashboard]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/Dashboard.html
58-
[Solid FillStyle]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/SolidFill.html
59-
[RGBA color factory]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/functions/ColorRGBA.html
60-
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/ChartXY.html
61-
[Axis]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/Axis.html
62-
[Pie chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/PieChart.html
63-
[Spider chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/SpiderChart.html
57+
[Dashboard]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/Dashboard.html
58+
[Solid FillStyle]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/SolidFill.html
59+
[RGBA color factory]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/functions/ColorRGBA.html
60+
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/ChartXY.html
61+
[Axis]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/Axis.html
62+
[Pie chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/PieChart.html
63+
[Spider chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/SpiderChart.html
6464

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"webpack-stream": "^7.0.0"
1818
},
1919
"dependencies": {
20-
"@arction/xydata": "^1.4.0",
21-
"@arction/lcjs": "^5.2.0"
20+
"@lightningchart/lcjs": "^6.0.0",
21+
"@lightningchart/xydata": "^1.4.0"
2222
},
2323
"lightningChart": {
2424
"eID": "0506"

src/index.js

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LightningChartJS example that showcases series/axes progressing to all kinds of directions inside a dashboard.
33
*/
44
// Import LightningChartJS
5-
const lcjs = require('@arction/lcjs')
5+
const lcjs = require('@lightningchart/lcjs')
66

77
// Extract required parts from LightningChartJS.
88
const {
@@ -84,9 +84,8 @@ const pieType = window.innerWidth > 850 ? PieChartTypes.LabelsOnSides : PieChart
8484
.setTitle('Power Consumption')
8585

8686
// ---- The Area Series both have the same baseline and direction. ----
87-
const areaCPU = xyChart.addAreaSeries({ type: AreaSeriesTypes.Positive }).setName('CPU')
88-
89-
const areaGPU = xyChart.addAreaSeries({ type: AreaSeriesTypes.Positive }).setName('GPU')
87+
const areaCPU = xyChart.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' }).setPointFillStyle(emptyFill).setName('CPU')
88+
const areaGPU = xyChart.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' }).setPointFillStyle(emptyFill).setName('GPU')
9089

9190
xyChart.getDefaultAxisX().setTitle('Component Load (%)')
9291
xyChart.getDefaultAxisY().setTitle('Watts')
@@ -151,20 +150,6 @@ const pieType = window.innerWidth > 850 ? PieChartTypes.LabelsOnSides : PieChart
151150
areaCPU.add(cpuData.map((point) => ({ x: point.x, y: point.x * 3.2 + Math.random() * 9.4 })))
152151
areaGPU.add(gpuData.map((point) => ({ x: point.x, y: point.x * 2.8 + Math.random() * 6.6 })))
153152

154-
// Set the custom result table
155-
areaCPU.setCursorResultTableFormatter((builder, series, position, highValue, lowValue) => {
156-
return builder
157-
.addRow('CPU')
158-
.addRow('Power Consumption ' + highValue.toFixed(0) + ' watts')
159-
.addRow('component load ' + position.toFixed(0) + ' %')
160-
})
161-
areaGPU.setCursorResultTableFormatter((builder, series, position, highValue, lowValue) => {
162-
return builder
163-
.addRow('GPU')
164-
.addRow('Power Consumption ' + highValue.toFixed(0) + ' watts')
165-
.addRow('component load ' + position.toFixed(0) + ' %')
166-
})
167-
168153
// Add XY Chart to LegendBox
169154
legend.add(xyChart)
170155
}
@@ -183,7 +168,7 @@ const pieType = window.innerWidth > 850 ? PieChartTypes.LabelsOnSides : PieChart
183168
.setAxisLabelFont((font) => font.setSize(14).setStyle('italic'))
184169

185170
chart
186-
.addSeries(PointShape.Circle)
171+
.addSeries()
187172
.setName('System Load')
188173
.addPoints(
189174
{ axis: 'CPU', value: 10 },
@@ -192,12 +177,6 @@ const pieType = window.innerWidth > 850 ? PieChartTypes.LabelsOnSides : PieChart
192177
{ axis: 'Hard-Drive', value: 40 },
193178
{ axis: 'GPU', value: 20 },
194179
)
195-
.setCursorResultTableFormatter((tableContentBuilder, series, value, axis, formatValue) =>
196-
tableContentBuilder
197-
.addRow(series.name)
198-
.addRow(axis)
199-
.addRow(value + ' %'),
200-
)
201180
// Add Spider Chart to LegendBox
202181
legend.add(chart)
203182
}

webpack.config.js

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
const HtmlWebpackPlugin = require("html-webpack-plugin");
2-
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
3-
const CopyWebpackPlugin = require("copy-webpack-plugin");
4-
const path = require("path");
5-
const webpack = require('webpack');
1+
const HtmlWebpackPlugin = require('html-webpack-plugin')
2+
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
3+
const CopyWebpackPlugin = require('copy-webpack-plugin')
4+
const path = require('path')
5+
const webpack = require('webpack')
66

7-
const targetFolderName = "dist";
8-
const outputPath = path.resolve(__dirname, targetFolderName);
9-
const packageJSON = require("./package.json");
7+
const targetFolderName = 'dist'
8+
const outputPath = path.resolve(__dirname, targetFolderName)
9+
const packageJSON = require('./package.json')
1010

1111
module.exports = {
12-
mode: "development",
13-
entry: {
14-
app: packageJSON.main,
15-
},
16-
devServer: {
17-
static: outputPath,
18-
compress: true,
19-
},
20-
resolve: {
21-
modules: [path.resolve("./src"), path.resolve("./node_modules")],
22-
extensions: [".js"],
23-
},
24-
output: {
25-
filename: "js/[name].[contenthash].bundle.js",
26-
chunkFilename: "js/[name].[contenthash].bundle.js",
27-
path: outputPath,
28-
},
29-
optimization: {
30-
splitChunks: {
31-
chunks: "all",
32-
cacheGroups: {
33-
// make separate 'vendor' chunk that contains any dependencies
34-
// allows for smaller file sizes and faster builds
35-
vendor: {
36-
test: /[\\/]node_modules[\\/]/,
37-
chunks: "initial",
38-
name: "vendor",
39-
priority: -10,
40-
reuseExistingChunk: true,
41-
},
42-
},
12+
mode: 'development',
13+
entry: {
14+
app: packageJSON.main,
4315
},
44-
runtimeChunk: "single",
45-
},
46-
plugins: [
47-
new CleanWebpackPlugin(),
48-
new HtmlWebpackPlugin({
49-
title: "app",
50-
filename: path.resolve(__dirname, "dist", "index.html"),
51-
}),
52-
new CopyWebpackPlugin({
53-
patterns: [
54-
{
55-
from: "./assets/**/*",
56-
to: `./examples/assets/${packageJSON.lightningChart.eID}/[name][ext]`,
57-
noErrorOnMissing: true,
58-
},
59-
{
60-
from: "./node_modules/@arction/lcjs/dist/resources",
61-
to: "resources",
62-
noErrorOnMissing: true,
16+
devServer: {
17+
static: outputPath,
18+
compress: true,
19+
},
20+
resolve: {
21+
modules: [path.resolve('./src'), path.resolve('./node_modules')],
22+
extensions: ['.js'],
23+
},
24+
output: {
25+
filename: 'js/[name].[contenthash].bundle.js',
26+
chunkFilename: 'js/[name].[contenthash].bundle.js',
27+
path: outputPath,
28+
},
29+
optimization: {
30+
splitChunks: {
31+
chunks: 'all',
32+
cacheGroups: {
33+
// make separate 'vendor' chunk that contains any dependencies
34+
// allows for smaller file sizes and faster builds
35+
vendor: {
36+
test: /[\\/]node_modules[\\/]/,
37+
chunks: 'initial',
38+
name: 'vendor',
39+
priority: -10,
40+
reuseExistingChunk: true,
41+
},
42+
},
6343
},
64-
],
65-
}),
66-
new webpack.DefinePlugin({
67-
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'",
68-
}),
69-
],
70-
};
44+
runtimeChunk: 'single',
45+
},
46+
plugins: [
47+
new CleanWebpackPlugin(),
48+
new HtmlWebpackPlugin({
49+
title: 'app',
50+
filename: path.resolve(__dirname, 'dist', 'index.html'),
51+
}),
52+
new CopyWebpackPlugin({
53+
patterns: [
54+
{
55+
from: './assets/**/*',
56+
to: `./examples/assets/${packageJSON.lightningChart.eID}/[name][ext]`,
57+
noErrorOnMissing: true,
58+
},
59+
{
60+
from: './node_modules/@lightningchart/lcjs/dist/resources',
61+
to: 'resources',
62+
noErrorOnMissing: true,
63+
},
64+
],
65+
}),
66+
new webpack.DefinePlugin({
67+
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'",
68+
}),
69+
],
70+
}

0 commit comments

Comments
 (0)