Marker Series

Overview

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.

to top

Adding Marker Series

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.

Data Provider

Sample XML for Marker Data Provider:

XML/JSON Syntax
Plain code
01 <data_provider data_set="dataSet1" id="dpS1">
02   <fields>
03     <field type="Value" column="4" approximation_type="Close" />
04   </fields>
01{
02  dataSet: "dataSet1",
03  id: "dpS1",
04  fields: [
05    {
06      type: "Value",
07      column: 4,
08      approximationType: "Close"
09    }
10  ]
11}

As you can see only one value field is defined. Now you can declare series that will use this Data Provider.

to top

Marker Series Declaration

XML syntax to declare series with Data Provider shown above:

XML/JSON Syntax
Plain code
01 <chart>
02   <series_list>
03     <series type="Marker" color="#253992" data_provider="dpS1">
04       <name><![CDATA[MSFT]]></name>
05     </series>
06   </series_list>
07 </chart>
01{
02  seriesList: [
03    {
04      type: "Marker",
05      color: "#253992",
06      dataProvider: "dpS1",
07      name: "MSFT"
08    }
09  ]
10}

Let's put this together and create the very basic Marker sample:

Live Sample:  Marker Series

to top

Configuring Visualization

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:

XML/JSON Syntax
Plain code
01 <series type="Marker" color="DarkRed" data_provider="dpS1">
02   <marker type="Diamond">
03     <fill color="%Color" opacity="0.9" />
04     <border color="Gold" opacity="0.1" />
05   </marker>
06   <name><![CDATA[MSFT]]></name>
07 </series>
01{
02  type: "Marker",
03  color: "DarkRed",
04  dataProvider: "dpS1",
05  marker: {
06    type: "Diamond",
07    fill: {
08      color: "%Color",
09      opacity: 0.9
10    },
11    border: {
12      color: "Gold",
13      opacity: 0.1
14    }
15  },
16  name: "MSFT"
17}

Live Sample below shows to charts with different Marker series, each with own specific settings:

Live Sample:  Marker Series Visual Settings

to top

Marker Types

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

to top

Legend Element

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.

to top

Tooltips

You can either use global tooltip settings or create personal tooltips for each series. See detailed description in Tooltips tutorial.

to top

Defaults Section

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:

XML/JSON Syntax
Plain code
01 <chart>
03     <marker_series>
04       <marker size="6">
05         <border thickness="2" color="DarkColor(%Color)" />
06       </marker>
07     </marker_series>
09 </chart>
01{
03    markerSeries: {
04      marker: {
05        size: 6,
06        border: {
07          thickness: 2,
08          color: "DarkColor(%Color)"
09        }
10      }
11    }
12  }
13}

Live sample below has three series of marker type. All common settings defined in <marker_series/> node :

Live Sample:  Marker Series - Using Defaults Sections

to top