JavaScript/jQuery Chart - Error Bars

Error bars are used on charts to indicate an error or uncertainty in a reported measurement. They give a general idea of how precise the measurement is.

DevExtreme HTML5 JavaScript Charts Error Bars

Error bars can be generated either from concrete or calculated values. To generate one error bar, two values, high and low, are needed. If your data source provides concrete high and low values, assign the required data source fields to the highValueField and lowValueField properties of the series.valueErrorBar object.

JavaScript
  • $(function() {
  • $("#chartContainer").dxChart({
  • // ...
  • dataSource: [
  • { arg: 1, val: 200, highError: 5, lowError: 3 },
  • // ...
  • ],
  • series: {
  • // ...
  • valueErrorBar: {
  • highValueField: 'highError',
  • lowValueField: 'lowError'
  • }
  • }
  • });
  • });

Alternatively, error bar values can be calculated according to an algorithm. In this case, choose the needed algorithm using the type property and specify the value to be used in calculation using the value property.

JavaScript
  • $(function() {
  • $("#chartContainer").dxChart({
  • // ...
  • series: {
  • // ...
  • valueErrorBar: {
  • type: 'percent',
  • value: 5
  • }
  • }
  • });
  • });

If error bars should have uniform settings, you can specify them using one of the commonSeriesSettings.valueErrorBar object. Individual series settings override common settings.

JavaScript
  • $(function() {
  • $("#chartContainer").dxChart({
  • // ...
  • series: {
  • valueErrorBar: {
  • // high priority
  • }
  • },
  • commonSeriesSettings: {
  • valueErrorBar: {
  • // low priority
  • }
  • }
  • });
  • });

For information about all properties of the error bars, visit the valueErrorBar section of the API reference.

View Demo