https://github.com/lightning-chart/lcjs-example-1601-valueindicatorgauge
https://github.com/lightning-chart/lcjs-example-1601-valueindicatorgauge
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lightning-chart/lcjs-example-1601-valueindicatorgauge
- Owner: Lightning-Chart
- License: mit
- Created: 2024-08-05T07:06:37.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-02-05T11:40:56.000Z (4 months ago)
- Last Synced: 2025-04-01T13:11:34.285Z (2 months ago)
- Language: JavaScript
- Size: 9.65 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gauge chart with value indicators

This demo application belongs to the set of examples for LightningChart JS, data visualization library for JavaScript.
LightningChart JS is entirely GPU accelerated and performance optimized charting library for presenting massive amounts of data. It offers an easy way of creating sophisticated and interactive charts and adding them to your website or web application.
The demo can be used as an example or a seed project. Local execution requires the following steps:
- Make sure that relevant version of [Node.js](https://nodejs.org/en/download/) is installed
- Open the project folder in a terminal:npm install # fetches dependencies
npm start # builds an application and starts the development server- The application is available at _http://localhost:8080_ in your browser, webpack-dev-server provides hot reload functionality.
## Description
This example shows the use of value indicators in a gauge chart.
Value indicators are elements to highlight additional value ranges in addition to the main gauge value interval.
Each value indicator must have a start value, an end value, and a color.```javascript
gauge.setValueIndicators([
{ start: 0, end: 25, color: ColorCSS('red') },
{ start: 25, end: 50, color: ColorCSS('orange') },
{ start: 50, end: 75, color: ColorCSS('yellow') },
{ start: 75, end: 100, color: ColorCSS('green') },
])
```
Value indicator labels can be also overridden:
```javascript
gauge.setValueIndicators([
{ start: 0, end: 50, color: ColorCSS('red'), startLabel: 'Start', endLabel: '' },
{ start: 50, end: 100, color: ColorCSS('green'), startLabel: 'Middle', endLabel: 'End' },
])
```To hide the default gauge labels:
```javascript
gauge.setTickFormatter((value) => {
if (value === gauge.getInterval().start || value === gauge.getInterval().end) {
return ''
}
return `${value}`
})
```
## API Links
* [Gauge Chart]
## Support
If you notice an error in the example code, please open an issue on [GitHub][0] repository of the entire example.
Official [API documentation][1] can be found on [LightningChart][2] website.
If the docs and other materials do not solve your problem as well as implementation help is needed, ask on [StackOverflow][3] (tagged lightningchart).
If you think you found a bug in the LightningChart JavaScript library, please contact [email protected].
Direct developer email support can be purchased through a [Support Plan][4] or by contacting [email protected].
[0]: https://github.com/Arction/
[1]: https://lightningchart.com/lightningchart-js-api-documentation/
[2]: https://lightningchart.com
[3]: https://stackoverflow.com/questions/tagged/lightningchart
[4]: https://lightningchart.com/support-services/© LightningChart Ltd 2009-2022. All rights reserved.
[Gauge Chart]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/classes/GaugeChart.html