Configuration

An object defining configuration options for the dxChart widget.

adjustOnZoom

Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart.

Type: Boolean
Default Value: true
Accepted Values: true|false

You can use the dxRangeSelector widget to perform zooming on the dxChart widget. In such an instance, the range selector and chart will have the same argument scale (axis). When an end-user selects a range in the range selector, the chart displays this range in the argument axis and the corresponding series part only. The adjustOnZoom property determines whether or not to change the value axis' visible range, so that its minimum and maximum values correspond to the values of the lowest and highest points of the currently visible series part. To learn how to implement chart zooming using a range selector, refer to the Zooming topic.

Show Example:
jQuery

In the following example, the dxRangeSelector widget is used to perform zooming on a Chart. You can see the adjusting of the value axis' labels while sliding the markers of the range selector. Use the check box in the bottom to set the adjustOnZoom option to false. In this instance, the Chart's value axis will not be adjusted.


                                    

                                    

animation

Specifies animation options for the dxChart widget.

Type: Object|Boolean

To make your chart "live", enable animation for it. To do this, set the enabled property of the animation object to true. In this instance, the chart's series will appear in motion from the value axis' minimum point. The animation object provides more properties to set up chart animation. Refer to their description for details.

Show Example:
jQuery

In the example below, the animation's duration option is altered to 2000 milliseconds and the type of easing is set to linear.


                                    

                                    

argumentAxis

Specifies argument axis options for the dxChart widget.

Type: Object

For charting, the rectangular coordinate system is used to determine each point uniquely on a plane through two numbers, the argument and the value of the point. Two perpendicular directed lines (the axis of arguments and the axis of values) are specified to define the coordinates. To define the argument axis, use the argumentAxis configuration object. To define the value axis (axes), use the valueAxis configuration object. To set the properties of all axes to a common value, use the commonAxisSettings configuration object. This object exposes the properties that can be specified for all axes simultaneously. Note that the value specified for an axis individually (in the argumentAxis or valueAxis object) overrides the value specified in the commonAxisSettings object.

Show Example:
jQuery

This example shows the argument axis of a discrete type. Here the axis is ordered by categories, divided using the 'crossLabels' mode and moved to the top of the chart. In addition, the grid lines of the axis are made visible.


                                    

                                    

argumentAxisClick

Specifies the callback function that is called when clicking the argument axis.

Type: function

This option allows you to specify the function that will be called when the argument axis is clicked. The function takes two parameters:

  • axis
    The object that provides access to the axis that was clicked.
  • argument
    The axis argument that was actually clicked.

The this object represents the axis as well as the axis parameter.

Show Example:
jQuery

In this example, the argument axis' labels respond to click.


                                    

                                    

commonAxisSettings

An object defining the configuration options that are common for all axes of the dxChart widget.

Type: Object

Use this object's properties to set the options for all chart axes at once. The option values will be applied to the argument axis and all values axes, which are defined in the valueAxis array. To set a common axis option for an axis individually, use the corresponding valueAxis or argumentAxis object. Values that are set individually override their corresponding common values.

Show Example:
jQuery

Here, the color and width options are changed for both axes.


                                    

                                    

commonPaneSettings

An object defining the configuration options that are common for all panes in the dxChart widget.

Type: Object

Use this object's properties to set options for all panes at once. If you need to set an individual value for a common option, use the corresponding pane object within the panes array. The values that are set individually override the corresponding common values.

Show Example:
jQuery

In this example, the panes of a multi-pane chart are separated one from another by a border colored in blue.


                                    

                                    

commonSeriesSettings

An object defining the configuration options that are common for all series of the dxChart widget.

Type: Object

Use this object's properties to set options for all chart series at once. These can be options common to all series types and options specific to series types.

If you have several series of one type, you can set options to the values specific to this series type using the corresponding object (area, line or another) within the commonSeriesSettings configuration object. The values that are set within type-specific configuration objects override the corresponding common values.

In case you have to set an option for an individual series, use the corresponding series object within the series array. The values that are set individually override the corresponding common values.

Show Example:
jQuery

containerBackgroundColor

Specifies the color of the parent page element.

Type: String
Default Value: '#FFFFFF'

If you set this property to the color of the parent page element, certain chart elements will use this color to coordinate with the page. For example, hovered points in the dxChart widget are painted in the color that is set to this property, but you can change this color to a custom color (see color).

Show Example:
jQuery

Here, the containerBackgroundColor option is changed to 'crimson'. To see the changes, hover over any point on the chart.


                                    

                                    

dataSource

Specifies a data source for the chart.

Type: Array

To provide data for a chart, introduce an array of objects. These objects must contain a property representing an argument value and property(ies) representing the value(s) that corresponds to that argument in each series. Assign this array to the dataSource property. In addition, specify which data source field must be used as a source for arguments and which one(s) as a source for values. To do this, use the argumentField and valueField properties of the series object. For details, refer to the Use Common Data Source topic.

Show Example:
jQuery

In this example, the data source is declared as an array of objects that each contain the 'arg', 'y1', 'y2' and 'y3' fields. The 'arg' field is used as an argument field for all series. The other fields are used as value fields for each series respectively.


                                    

                                    

defaultPane

Specifies a default pane for the chart's series.

Type: String
Default Value: 'default'

When there are several panes declared, be sure to specify on which pane each series must be displayed. If a pane is not specified for a series, the series is displayed on a default pane. The default pane is specified by the chart's defaultPane property. If you do not specify this property, the last pane in the panes array is considered the default. When there is only one pane in the chart, it's named 'default' and is considered to be the default.

Show Example:
jQuery

In this example, the 'topPane' pane is declared as the default pane using the defaultPane option. Thus, series that do not have a pane specified are displayed on the default pane.


                                    

                                    

done

A callback function that is called when chart rendering is complete.

Type: function
Default Value: Empty function ($.noop)

Show Example:
jQuery

In this example, when chart rendering is complete, a message with the corresponding content appears.


                                    

                                    

equalBarWidth

Specifies a value indicating whether all bars of the same series must always have the same width, or may have different widths if the points of other series are missing.

Type: Object|Boolean
Default Value: true

If some values for a series are not specified or are set to zero, the bars that represent these values will be missing from the chart. To fill the empty area by extending the neighboring bars, set the equalBarWidth property to false. The bars will have different widths, but there will be no empty areas.

To set a custom width for bars, as well as the spacing between bars, assign an object to this property and specify the width and spacing properties, respectively.

Show Example:
jQuery

Use the check box at the bottom to switch the value of the equalBarWidth option.


                                    

                                    

incidentOccured

Specifies a callback function that is called when an error or warning occurs.

Type: function
Default Value: Empty function ($.noop)

When an error or warning occurs, nothing passes to the browser console, but the function specified for the incidentOccured option is called. Information about the incident is available via the parameter of the function. For example, you will be notified when data is input in the wrong format, or when the chart container is too small.

Show Example:
jQuery

In this example, the type of the argument axis values is 'numeric'. Change it to 'string' using the drop-down list below the chart to induce an error. Information about the error will be displayed.


                                    

                                    

legend

Specifies chart legend options.

Type: Object

The dxChart widget can include a legend - an explanatory component that helps you identify a series. Each series is represented by an item on a Legend. An item marker identifies the series color. An item label displays the series title. To set the required position for a legend and its items, to customize the font settings for item labels, and to specify the size of item markers, use the properties of the legend configuration object. To learn more about the legend and its options, refer to the Legend topic.

Show Example:
jQuery

In this example, the legend's horizontalAlignment and verticalAlignment options are changed.


                                    

                                    

margin

Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels.

Type: Object

Set the required values for the left, right, top and bottom margins using the corresponding properties of the margin object.

ChartMargin ChartJS

palette

Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart.

Type: Array|String
Default Value: 'default'

Use this property to set a predefined or custom palette. The colors listed in the specified palette will be used to draw chart series, their points, labels and tooltips. If the number of series is greater than the number of colors in the palette, palette colors are repeated, but slightly modified.

You can override the color of individual series and their points, labels and tooltips, by setting the color property of the corresponding object. In addition, you can define a custom palette to use in your charts. To learn how to do this, refer to the Palettes topic.

Show Example:
jQuery

This example shows how to create a custom palette and apply it to a chart.


                                    

                                    

panes

Defines the dxChart widget's pane(s).

Type: Object|Array

A Pane is a visual area within a chart that includes all the elements required to display data. If you need to plot several series, you can distribute them between several panes. In this instance, the series are easily compared to each other and provide the entire picture of the presented data. To define panes, introduce the object panes array. Each object represents a single pane. To identify panes, set their name property.

If you need to set similar values to properties of several panes, use the commonPaneSettings configuration object. It exposes the properties that can be specified for all panes at once. Note that the values specified for a pane individually (in the panes array) override the values that are specified for all panes (in the commonPaneSettings object).

If you plot all series on one pane, use the panes configuration object to make the pane's border visible, set up border options or set the pane's background color, if required.

View Demo

Show Example:
jQuery

In this example, two panes are used to represent data. Each pane is defined within the panes array.


                                    

                                    

pointClick

Specifies a function that is called when a series data point is clicked.

Type: function

When implementing a callback function for this property, use the object that represents the currently clicked point. To access this object, use the function's parameter or the this object.

For information on which point members you can use, refer to the Point class description. For instance, you can access the series to which the point belongs. To learn about which series members you can use, refer to the description of any series type in the chart Series Types section.

To learn more about handling click operations, and to see an example, refer to the Click Handling topic.

Show Example:
jQuery

Click one of the points on the chart, and a message with the data on this point will appear below.


                                    

                                    

pointHover

Specifies the function that is called when a data point is hovered over.

Type: function

When implementing a callback function for this property, use the object that represents the currently hovered point. To access this object, use the function's parameter or the this object.

To learn about which point members you can use, refer to the Point class description. For instance, you can access the series to which the point belongs. To learn about which series members you can use, refer to the description of any series type in the chart Series Types section.

To learn more about handling hover operations and to see an example, refer to the Hover Handling topic.

Show Example:
jQuery

Hover over one of the points on the chart, and a message with the data on this point will appear below.


                                    

                                    

pointSelected

Specifies the function that is called after a series data point has been selected.

Type: function

When implementing a callback function for this property, use the object that represents the currently selected point. To access this object, use the function's parameter or the this object.

To learn about which point members you can use, refer to the Point class description. For instance, you can access the series to which the point belongs. To learn about which series members you can use, refer to the description of any series type in the chart Series Types section.

To learn how to select a point, refer to the Selection Handling topic.

Show Example:
jQuery

In this example, a click on a point makes this point selected. This selection is handled by the function specified in the pointSelected option. Here, this function displays information about the selected point.


                                    

                                    

pointSelectionMode

Specifies whether a single point or multiple points can be selected in the chart.

Type: String
Default Value: 'single'
Accepted Values: 'single' | 'multiple'

To set the points to highlight along with the selected point, set the series | point | selectionMode option.

To learn how to select a point, refer to the Selection Handling topic.

Show Example:
jQuery

In this example, click a point to select/deselect this point. The pointSelectionMode option is set to multiple so that you can select multiple points. When selecting a point, the Total value of selected points number represented below is changed. Click the Clear selected points button to deselect all points at once.


                                    

                                    

redrawOnResize

Indicates whether to redraw the chart when the size of the parent browser window changes or a mobile device is rotated.

Type: Boolean
Default Value: true
Accepted Values: true|false

The size of the chart is never changed when its container has a fixed size. Alternatively, its size changes proportionally when the parent window size changes and the redrawOnResize is set to true.

rotated

Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical.

Type: Boolean
Default Value: false
Accepted Values: true|false

Show Example:
jQuery

In this example, the chart is rotated.


                                    

                                    

series

Specifies options for series of the dxChart widget.

Type: {object|Array
Default Value: undefined

A series represents a grouping of related data points. The most important characteristic of a series is its type, which determines a particular visual representation of data. You can find more details on each series type in the corresponding topics in the Series help section.

To define a single series, assign an object defining the series to the series configuration object. In the series' object, specify the series type, data source fields, the appearance of the series points and other options.

To show several series, specify series as an array of objects defining series. If you need to set similar values to properties of several series, use the commonSeriesSettings configuration object. It exposes the properties that can be specified for all series at once and for all series of a particular type at once. Note that the values specified for a series individually (in the series array) override the values that are specified for all series (in the commonSeriesSettings object).

Show Example:
jQuery

seriesClick

Specifies a function that is called when a series is clicked.

Type: function

When implementing a callback function for this property, use the object that represents the currently clicked series. To access this object, use the function's parameter or the this object.

To learn about the series members you can use, refer to the description of the Series object.

To learn more about handling click operations, and to see an example, refer to the Click Handling topic.

Show Example:
jQuery

Click one of the series on the chart, and the information on the maximum value in this series will appear below.


                                    

                                    

seriesHover

Specifies a function that is called when a series is hovered over.

Type: function

When implementing a callback function for this property, use the object that represents the currently hovered series. To access this object, use the function's parameter or the this object.

To learn about which series members you can use, refer to the description of the Series object.

To learn more about handling hover operations and view an example, refer to the Hover Handling topic.

Show Example:
jQuery

Hover over one of the series on the chart, and the information on the maximum value in this series will appear below.


                                    

                                    

seriesSelected

Specifies a callback function that is called after a series has been selected.

Type: function

When implementing a callback function for this property, use the object that represents the series that is currently selected. To access this object, use the function's parameter or the this object.

To learn about which series members you can use, refer to the description of any series type in the Reference | Charts section.

To learn how to select a series, refer to the Selection Handling topic.

Show Example:
jQuery

In this example, a click on a series makes this series selected. This selection is handled by the function specified in the seriesSelected option. Here, this function displays information about the maximum value in the selected series.


                                    

                                    

seriesSelectionMode

Specifies whether a single series or multiple series can be selected in the chart.

Type: String
Default Value: 'single'
Accepted Values: 'single' | 'multiple'

To set the series elements to highlight when a series is selected, set the series selectionMode option.

To learn how to select a point, refer to the Selection Handling topic.

Show Example:
jQuery

In this example, the seriesSelectionMode option is set to multiple. Click a series on the chart to select/deselect this series.


                                    

                                    

seriesTemplate

Defines options for the series template.

Type: Object
Default Value: undefined

In most cases, you can organize the array that is assigned to the chart's dataSource option in the following way:

[
    {arg: arg1Value, series1Value: val11, series2Value: val12, ...}
    {arg: arg2Value, series1Value: val21, series2Value: val22, ...}
    ...
    {arg: argNValue, series1Value: valN1, series2Value: valN2, ...}
]

Each object that is included in the array represents an argument value and the values of all series for this argument.

However, there are some scenarios in which you do not know exactly how many series will be added. In these cases, you will not be able to define the data source in the manner detailed above. Instead, define it in the following way:

[
    {seriesName: series1, arg: arg11Value, val: value11 }
    {seriesName: series1, arg: arg12Value, val: value12 }
    ...
    {seriesName: seriesM, arg: argM1Value, val: valueM1 }
    {seriesName: seriesM, arg: argM2Value, val: valueM2 }
    ...
]

If you define a data source in this manner, set the argument and value fields using the argumentField and valueField properties of the commonSeriesSettings configuration object (for all series at once). In addition, define a template for the series using the seriesTemplate configuration object. Within this object, set the data source field that specifies the series name.

Define all series at once using the commonSeriesSettings object. If you need to specify individual values for options of a particular series, assign a callback function to the customizeSeries option of the seriesTemplate.

To see an example, refer to the Series Template demo.

size

Specifies the size of the widget in pixels.

Type: Object

The widget occupies the entire area of the parent container (division). If the container size (width or height) is set to zero, the widget is not displayed.

If you need to set a particular size for the widget, different from the container's size, use the size configuration object. Assign a height and width in pixels to height and width properties.

Show Example:
jQuery

In this example, the size of the chart is set smaller than the size of the chart container using the size option.


                                    

                                    

synchronizeMultiAxes

Indicates whether or not to synchronize value axes when they are displayed on a single pane.

Type: Boolean
Default Value: true
Accepted Values: true|false

When synchronized, the ticks (or grid lines) of all the value axes in a pane are located on the same line.

Show Example:
jQuery

In this example, a multi-axes chart is displayed. Toggle the check box below to choose whether or not to synchronize the labels of the value axes.


                                    

                                    

theme

Sets the name of the theme to be used in the chart.

Type: String
Default Value: 'default'

Use this property to set a predefined or custom theme. The options defining chart appearance will be set to the values that are set in the specified theme. You can override some of these values within the chart's configuration object. To learn more about themes and their implementation and customization, refer to the Themes topic.

Show Example:
jQuery

In this example, a custom theme is defined on the base of the default theme and then applied.


                                    

                                    

title

Specifies a title for the chart.

Type: Object|String

Use this property to set the text to be displayed as a chart title. If you need to specify the title's position on the chart, assign an object to the title property with the required title options specified. In this instance, set the title's text using the text property. When a text is not specified for a title, the widget is displayed without a title.

Show Example:
jQuery

In the example below, the chart's title text is assigned directly to the title field.


                                    

                                    

tooltip

Specifies tooltip options.

Type: Object

A tooltip is a small pop-up rectangle that displays information about a hovered series point. You can enable or disable tooltips, format or customize the displayed text, and change the default appearance. Use the properties of the tooltip configuration object to do this. To learn more on tooltips and their options, refer to the Tooltips topic.

Show Example:
jQuery

In this example, the tooltips are enabled. Hover over any point to see a tooltip.


                                    

                                    

tooltipHidden

A callback function that is called when a point tooltip becomes hidden.

Type: function
Default Value: Empty function ($.noop)

The point tooltip becomes invisible when another point is hovered. In addition, you can hide a tooltip in code, using the hideTooltip() method of the chart or point.

When a tooltip is made hidden, you can perform specific actions. To do this, implement a callback function and assign it to the tooltipHidden option. When implementing this callback function, use the object that represents the point whose tooltip becomes hidden. To access this object, use the function's parameter or the this object.

Show Example:
jQuery

In this example, when a tooltip is made hidden, the function assigned to the tooltipHidden option is called. When a tooltip is shown, the function assigned to the tooltipShown option is called. These functions display messages with the corresponding content.


                                    

                                    

tooltipShown

A callback function that is called when a point tooltip becomes shown.

Type: function
Default Value: Empty function ($.noop)

The point tooltip becomes visible when the point is hovered. In addition, you can show a tooltip in code, using the showTooltip() method of the chart or point.

When a tooltip is made shown, you can perform specific actions. To do this, implement a callback function and assign it to the tooltipShown option. When implementing this callback function, use the object that represents the point whose tooltip becomes shown. To access this object, use the function's parameter or the this object.

Show Example:
jQuery

In this example, when a tooltip is made hidden, the function assigned to the tooltipHidden option is called. When a tooltip is shown, the function assigned to the tooltipShown option is called. These functions display messages with the corresponding content.


                                    

                                    

valueAxis

Specifies value axis options for the dxChart widget.

Type: Object|Array

For charting, the rectangular coordinate system is used to determine each point uniquely on a plane through two numbers, the argument and the value of the point. Two perpendicular lines (the axis of arguments and the axis of values) are specified to define the coordinates. To define the argument axis, use the argumentAxis configuration object. To define the value axis, use the valueAxis configuration object. When series are displayed on several panes, there should be a value axis for each pane defined. In addition, different series can be displayed using different value axes on one pane. In these instances, the valueAxis can be an array of objects representing values axes.

To set the properties of all axes to a common value, use the commonAxisSettings configuration object. It exposes properties that can be specified for all axes simultaneously. Note that the value specified for an axis individually (in the argumentAxis or valueAxis object) overrides the value that specified in the commonAxisSettings object.

Show Example:
jQuery

In this example, the value axis' axisDivisionFactor option is set to 15, and the minValueMargin and maxValueMargin options are set to 0.04.