01 | { |
02 | dataSet: "dataSet1" , |
03 | id: "dpS1" , |
04 | fields: [ |
05 | { |
06 | type: "Value" , |
07 | column: 4 , |
08 | approximationType: "Close" |
09 | } |
10 | ] |
11 | } |
Marker chart, also known as a point chart is identical to a line chart without the lines. A marker chart shows only endpoints of segments that make up each line.
Before you can add Marker series to the chart you need to prepare Data Provider. You need one field to create Marker chart: value. So the Data Provider should contain this field.
Sample XML for Marker Data Provider:
As you can see only one value field is defined. Now you can declare series that will use this Data Provider.
XML syntax to declare series with Data Provider shown above:
Let's put this together and create the very basic Marker sample:
All visual and specific settings for Bar series are set in <marker_series> in <series> node.
The border of bars is configured using <border> subnode of <marker> node in <marker_series>: <border thickness="3"/>.
The color and opacity of bars is configured in <fill> subnode of subnode of <marker> node in <marker_series> node: <fill color="%Color" opacity="1"/>
Sample XML with width and and different visualization:
Live Sample below shows to charts with different Marker series, each with own specific settings:
Marker Type and size is set in <marker> subnode of <marker_settings> node using type and size attributes. The table below lists all available marker types:
Type | |
---|---|
Circle | |
Square | |
Diamond | |
Cross | |
DiagonalCross | |
HLine | |
VLine | |
Star4 | |
Star5 | |
Star6 | |
Star7 | |
TriangleUp | |
TriangleDown |
For each series you can define its element in legend. This element contains the settings for the formatting string of the text in legend that represents the series. Configuration of such elements is described in Legend: Series Labels article.
You can either use global tooltip settings or create personal tooltips for each series. See detailed description in Tooltips tutorial.
There is a special section to set default values in AnyChart Stock component XML: <series_settings>, where you can define marker and value highlighter settings for all series of the given type in one place, instead of setting them for each series individually.
For example, to configure line in one chart for all series of Marker type just set:
Live sample below has three series of marker type. All common settings defined in <marker_series/> node :