Skip to content

Commit 2178fb1

Browse files
author
Niilo Keinänen
committed
v6.0.0
1 parent fa6a9e7 commit 2178fb1

File tree

4 files changed

+102
-96
lines changed

4 files changed

+102
-96
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
135135
© LightningChart Ltd 2009-2022. All rights reserved.
136136

137137

138-
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/ChartXY.html
139-
[RGBA color factory]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/functions/ColorRGBA.html
140-
[Point series]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/PointSeries.html
141-
[Point Shape options]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/enums/PointShape.html
138+
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/ChartXY.html
139+
[RGBA color factory]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/functions/ColorRGBA.html
140+
[Point series]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/PointSeries.html
141+
[Point Shape options]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/enums/PointShape.html
142142
[Random trace data generator]: https://arction.github.io/xydata/classes/tracegenerator.html
143143

package.json

+2-2
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": "^5.2.0",
21+
"@lightningchart/xydata": "^1.4.0"
2222
},
2323
"lightningChart": {
2424
"eID": "0001"

src/index.js

+31-25
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,10 @@
22
* LightningChartJS example that showcases a simple scatter series.
33
*/
44
// Import LightningChartJS
5-
const lcjs = require('@arction/lcjs')
5+
const lcjs = require('@lightningchart/lcjs')
66

77
// Extract required parts from LightningChartJS.
8-
const {
9-
lightningChart,
10-
AxisTickStrategies,
11-
emptyLine,
12-
PointShape,
13-
SolidFill,
14-
ColorRGBA,
15-
UIElementBuilders,
16-
UIButtonPictures,
17-
LegendBoxBuilders,
18-
Themes,
19-
} = lcjs
8+
const { lightningChart, AxisTickStrategies, emptyLine, PointShape, emptyFill, LegendBoxBuilders, Themes } = lcjs
209

2110
// Create a XY Chart.
2211
const chart = lightningChart({
@@ -34,9 +23,13 @@ chart
3423
end: new Date(2018, 8, 29).getTime(),
3524
})
3625

37-
chart.getDefaultAxisY().setScrollStrategy(undefined).setTitle('Units Sold').setInterval({ start: 0, end: 2000, stopAxisAfter: false })
26+
chart.axisY
27+
.setScrollStrategy(undefined)
28+
.setTitle('Revenue')
29+
.setUnits('$')
30+
.setInterval({ start: 0, end: 2000, stopAxisAfter: false })
3831

39-
chart.setTitle('Product Sales').setAutoCursor((cursor) => {
32+
chart.setTitle('Product Sales').setCursor((cursor) => {
4033
cursor.setTickMarkerYVisible(false)
4134
cursor.setGridStrokeYStyle(emptyLine)
4235
})
@@ -51,9 +44,27 @@ const legend = chart
5144
})
5245

5346
// Create series.
54-
const smartPhonesSeries = chart.addPointSeries({ pointShape: PointShape.Circle }).setName('Smart Phones').setPointSize(10)
55-
const laptopsSeries = chart.addPointSeries({ pointShape: PointShape.Square }).setName('Laptops').setPointSize(10)
56-
const smartTvSeries = chart.addPointSeries({ pointShape: PointShape.Triangle }).setName('Smart TV').setPointSize(10)
47+
const smartPhonesSeries = chart
48+
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
49+
.setAreaFillStyle(emptyFill)
50+
.setStrokeStyle(emptyLine)
51+
.setPointShape(PointShape.Circle)
52+
.setName('Smart Phones')
53+
.setPointSize(10)
54+
const laptopsSeries = chart
55+
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
56+
.setAreaFillStyle(emptyFill)
57+
.setStrokeStyle(emptyLine)
58+
.setPointShape(PointShape.Star)
59+
.setName('Laptops')
60+
.setPointSize(10)
61+
const smartTvSeries = chart
62+
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
63+
.setAreaFillStyle(emptyFill)
64+
.setStrokeStyle(emptyLine)
65+
.setPointShape(PointShape.Triangle)
66+
.setName('Smart TV')
67+
.setPointSize(10)
5768

5869
// Data for the plotting
5970
const smartPhoneData = [
@@ -346,11 +357,6 @@ legend.add(smartPhonesSeries)
346357
legend.add(laptopsSeries)
347358
legend.add(smartTvSeries)
348359

349-
// Enable AutoCursor auto-fill.
350-
chart.setAutoCursor((cursor) => {
351-
cursor
352-
.setResultTableAutoTextStyle(true)
353-
.setTickMarkerXVisible(false)
354-
.setTickMarkerXAutoTextStyle(false)
355-
.setTickMarkerYAutoTextStyle(false)
360+
chart.setCursor((cursor) => {
361+
cursor.setTickMarkerXVisible(false)
356362
})

webpack.config.js

+65-65
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)