diff --git a/README.md b/README.md index 507229d..36b20aa 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index 4c89a4f..d9f2a9a 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/index.js b/src/index.js index 553c4b5..febf385 100644 --- a/src/index.js +++ b/src/index.js @@ -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 = [ @@ -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) + '%') -}) diff --git a/webpack.config.js b/webpack.config.js index d7c6b04..1d3835b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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 + "'", + }), + ], +}