Skip to content

Commit

Permalink
v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Niilo Keinänen committed Aug 5, 2024
1 parent 58f5a3c commit da8e657
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 91 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
© LightningChart Ltd 2009-2022. All rights reserved.


[Axis tick strategies]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/AxisTickStrategies.html
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/ChartXY.html
[Line series]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/LineSeries.html
[Axis tick strategies]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/AxisTickStrategies.html
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/ChartXY.html
[Line series]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/LineSeries.html

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"webpack-stream": "^7.0.0"
},
"dependencies": {
"@arction/xydata": "^1.4.0",
"@arction/lcjs": "^5.2.0"
"@lightningchart/lcjs": "^6.0.0",
"@lightningchart/xydata": "^1.4.0"
},
"lightningChart": {
"eID": "0020"
Expand Down
34 changes: 13 additions & 21 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
* LightningChart JS Example that showcases a Customer Satisfaction graph using a LineSeries and DateTime-Axis.
*/
// Import LightningChartJS
const lcjs = require('@arction/lcjs')
const lcjs = require('@lightningchart/lcjs')

// Extract required parts from LightningChartJS.
const { lightningChart, AxisTickStrategies, Themes } = lcjs
const { lightningChart, AxisTickStrategies, emptyFill, Themes } = lcjs

// Create a XY Chart.
const chart = lightningChart({
resourcesBaseUrl: new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'resources/',
}).ChartXY({
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
}).setTitle('Customer Satisfaction')
})
.ChartXY({
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
})
.setTitle('Customer Satisfaction')

// Use DateTime TickStrategy for this Axis
chart.getDefaultAxisX().setTickStrategy(
AxisTickStrategies.DateTime
)
chart.getDefaultAxisX().setTickStrategy(AxisTickStrategies.DateTime)

// Add a line series.
const lineSeries = chart.addLineSeries().setName('Customer Satisfaction')
const lineSeries = chart
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
.setName('Customer Satisfaction')
.setAreaFillStyle(emptyFill)

// Setup view nicely.
chart.getDefaultAxisY()
.setScrollStrategy(undefined)
.setInterval({ start: 0, end: 100, stopAxisAfter: false })
.setTitle('Satisfaction %')
chart.axisY.setScrollStrategy(undefined).setInterval({ start: 0, end: 100, stopAxisAfter: false }).setTitle('Satisfaction').setUnits('%')

// Data for the plotting
const satisfactionData = [
Expand Down Expand Up @@ -155,11 +155,3 @@ const satisfactionData = [

// Adding points to the series
lineSeries.add(satisfactionData)

// Show the customized result table for each point
lineSeries.setCursorResultTableFormatter((builder, series, xValue, yValue) => {
return builder
.addRow('Customer Satisfaction')
.addRow(series.axisX.formatValue(xValue))
.addRow(yValue.toFixed(2) + '%')
})
130 changes: 65 additions & 65 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require("path");
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const path = require('path')
const webpack = require('webpack')

const targetFolderName = "dist";
const outputPath = path.resolve(__dirname, targetFolderName);
const packageJSON = require("./package.json");
const targetFolderName = 'dist'
const outputPath = path.resolve(__dirname, targetFolderName)
const packageJSON = require('./package.json')

module.exports = {
mode: "development",
entry: {
app: packageJSON.main,
},
devServer: {
static: outputPath,
compress: true,
},
resolve: {
modules: [path.resolve("./src"), path.resolve("./node_modules")],
extensions: [".js"],
},
output: {
filename: "js/[name].[contenthash].bundle.js",
chunkFilename: "js/[name].[contenthash].bundle.js",
path: outputPath,
},
optimization: {
splitChunks: {
chunks: "all",
cacheGroups: {
// make separate 'vendor' chunk that contains any dependencies
// allows for smaller file sizes and faster builds
vendor: {
test: /[\\/]node_modules[\\/]/,
chunks: "initial",
name: "vendor",
priority: -10,
reuseExistingChunk: true,
},
},
mode: 'development',
entry: {
app: packageJSON.main,
},
runtimeChunk: "single",
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: "app",
filename: path.resolve(__dirname, "dist", "index.html"),
}),
new CopyWebpackPlugin({
patterns: [
{
from: "./assets/**/*",
to: `./examples/assets/${packageJSON.lightningChart.eID}/[name][ext]`,
noErrorOnMissing: true,
},
{
from: "./node_modules/@arction/lcjs/dist/resources",
to: "resources",
noErrorOnMissing: true,
devServer: {
static: outputPath,
compress: true,
},
resolve: {
modules: [path.resolve('./src'), path.resolve('./node_modules')],
extensions: ['.js'],
},
output: {
filename: 'js/[name].[contenthash].bundle.js',
chunkFilename: 'js/[name].[contenthash].bundle.js',
path: outputPath,
},
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
// make separate 'vendor' chunk that contains any dependencies
// allows for smaller file sizes and faster builds
vendor: {
test: /[\\/]node_modules[\\/]/,
chunks: 'initial',
name: 'vendor',
priority: -10,
reuseExistingChunk: true,
},
},
},
],
}),
new webpack.DefinePlugin({
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'",
}),
],
};
runtimeChunk: 'single',
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: 'app',
filename: path.resolve(__dirname, 'dist', 'index.html'),
}),
new CopyWebpackPlugin({
patterns: [
{
from: './assets/**/*',
to: `./examples/assets/${packageJSON.lightningChart.eID}/[name][ext]`,
noErrorOnMissing: true,
},
{
from: './node_modules/@lightningchart/lcjs/dist/resources',
to: 'resources',
noErrorOnMissing: true,
},
],
}),
new webpack.DefinePlugin({
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'",
}),
],
}

0 comments on commit da8e657

Please sign in to comment.