What is the use of commonSeriesOptions in the Chart?
The commonSeriesOptions property allows you to customize marker, data label and other properties of all the series in the Chart. All the properties except the points property in the series are customizable by using the commonSeriesOptions property.
For example, changing the marker shape in the commonSeriesOptions changes the marker shape of all the series. To customize the marker and other properties for a specific series, you need to provide the values to the properties of that specific series in the series collection. In general, values provided to the series in series collection overrides the values provided through commonSeriesOptions. Refer to the following code example.
JS
$("#container").ejChart({ //Enabling marker for all series through commonSeriesOptions commonSeriesOptions: { marker: { visible:true } }, series: [{ points: [ { x: 1, y: 25 }, { x: 2, y: 36 }, { x: 3, y:41 }, { x: 4, y: 61 } ], //Customizing marker specifically for first series marker: { visible: true, size: { width: 10, height: 10 }, fill: 'blue' } }, { points: [ { x: 1, y: 35 }, { x: 2, y: 26 }, { x: 3, y: 51 }, { x: 4, y: 69 } ] }, { points: [ { x: 1, y: 72 }, { x: 2, y: 29 }, { x: 3, y: 48 }, { x: 4, y: 39 } ] }, { points: [ { x: 1, y: 52 }, { x: 2, y: 58 }, { x: 3, y: 32 }, { x: 4, y: 11 } ] }] . . . . . . . . . . . . . . });
The following screenshot displays the Chart with markers enabled by using the commonSeriesOptions and the marker fill color is customized specifically for the first series by using series collection.
JS Playground sample link: CommonSeriesOptions