Optional development or deployment license. If omitted, a community license will be used.
Additional information for license verification. Only required by Application Deployment license.
Optionally supplieable data structure for overriding mouse buttons that trigger user interactions.
See OverrideInteractionMouseButtons for full list of supported overrides.
Example usage:
const lcjs = lightningChart({
// LightningChartOptions
overrideInteractionMouseButtons: {
chartXYPanMouseButton: 0, // LMB
chartXYRectangleZoomFitMouseButton: 2, // RMB
}
})
// Create charts...
const chart = lcjs.ChartXY()
Specify URL path to file server that hosts LightningChart JS resources.
LightningChart JS is distributed along with some resource files, which are required for select features only:
resources/maps/
)resources/osm/
)When any of these features are used, the user has to ensure that the necessary resources are hosted on a file server where LightningChart JS can fetch them.
Example local file server with http-server
from node_modules
:
npm i --global http-server
cd node_modules/@arction/lcjs/dist/resources
http-server --cors
const lcjs = lightningChart({
resourcesBaseUrl: 'http://127.0.0.1:8081', // <--- or whichever port http-server assigned.
})
Node Js:
When using LightningChart JS in Node JS environment with lcjs-headless you will need to provide a path to the resource files.
This path needs to be provided with syntax fs:<path>
. For example:
const lcjs = lightningChart({
resourcesBaseUrl: `fs:${path.resolve(__dirname, 'node_modules', '@arction', 'lcjs', 'dist', 'resources')}`
})
Troubleshooting:
If LightningChart JS can't fetch any required resource, it will result in an error. Here is a list of common resource issues:
1. Resources are not hosted.
In LightningChart JS template projects, the hosting of resources is built-in. However, in users own projects, it is the users responsibility to setup a file server for LightningChart JS resources if they are required.
2. Resources server URL is wrong.
Please make sure that the configured resourcesBaseUrl
points to URL landing inside resources
folder.
resourcesBaseUrl
should not end with a '/'
.
For example, 'http://127.0.0.1:8081'
is a valid value. 'http://127.0.0.1:8081/'
might result in an error.
3. Request is CORS blocked.
A common issue especially when first starting development / testing.
For example, when hosting resources
folder with http-server
npm module, the extra cors
flag must be supplied.
cd node_modules/@arction/lcjs/dist/resources
http-server --cors
Optional configuration for instructing desired reaction to warnings that can have small side-effects, like decreasing performance or which might indicate issues in application code.
By default these warnings are enabled, which might result in some output to browser console, stdout or such channels.
By setting warnings
to false
, this kind of warnings can be disabled.
// Example syntax, disable low-level warnings.
const chart = lightningChart({
warnings: false
}).ChartXY()
Interface for configuring LightningChart JS initialization, before any charts or series are created.
Supplied when
lightningChart
function is called:const lcjs = lightningChart({ // Either supply license number, or omit for automatic community license. // license: 'my-license-number' }) // Create charts... const chart = lcjs.ChartXY()