Charts are composed of several components:
axis-minimum, axis-maximum, and axis-crossover attributes. Formatting attributes are a special kind of attribute used only in formatting freeform tables and charts. Annotations are statements that describe the value of one or more formatting attributes of a chart component.
Trend chart annotations explicitly state the components to which they refer. They begin with a component statement, followed by one or more component attributes and values, such as:
1 value-axis;
the label-color of value-axis 1 is red
label-color attribute has a value of red. In contrast, chart annotations do not explicitly state the component to which they refer. The attribute name indicates the relevant component, as these annotations do:
the grid-color of axis 1 is purple;
the indicator of any data-point of data-series 1 is solid-column
grid-color is a chart component attribute, and indicator is an attribute of the chart's data point component. While you can enter chart annotations in any order, G2 may regroup certain attributes so that they appear together for one component.
Shaded component attributes without values are those that have an unspecified default. For these attributes, G2 calculates an appropriate value based upon the data that the chart is plotting.
Axis Component Attributes
Here are the axis component attributes. Specifying the Minimum and Maximum Axis Values
The Axis-minimum and the Axis-maximum attributes specify a number on the axis that shows the beginning and end of the range of data. Axis 1 is the horizontal axis and axis 2 is the vertical axis. An example is:
the axis-minimum of axis 1 = -20
the axis-maximum of axis 1 = 10
Axis-crossover attribute specifies a point on the axis where the other axis crosses it. The point is an integer, whose default value is zero. If zero is not on the axis, the default is the axis-minimum. If you specify an axis-crossover value that is outside the axis range, G2 overrides it and uses the axis-minimum value. An example is:
the axis-crossover of axis 1 = 4.7
Number-of-tickmarks attribute specifies the number of tickmarks on the axis. An example is:
the number-of-tickmarks of axis 1 = 4
Tickmarks-interval attribute specifies the distance between successive tickmarks on an axis. An example is:
the tickmark-interval of axis 2 = 5
Background-color attribute determines the background color of the entire chart. Unlike trend charts, there is no way to separate the background color of the actual data window, in which the data series values display, from the outer edge of that area. The default background color is transparent.
Border-color annotation determines the chart's external border color. There is no annotation to set the border that bounds the data window area, in which the data series values appear. The default is black.
Grid-color attribute specifies the color of the grid for either axis. Conceptually, a grid is an extension of an axis tickmark to the full size of the chart. You can specify a grid-color for both axes, or for either axis individually. Some examples are:
the grid-color is light-blue
the grid-color of axis 1 is pale-green
Grid-visible attribute turns grid lines on or off (true and false, respectively) for either or both axes. Some examples are:
the grid-visible is true
the grid-visible of axis 2 is false
height and width attributes specify the height and width of a data point in pixels. Enter this attribute as an integer value. The height and width attributes are not applicable to line charts. The default value varies depending on the indicator you use. To change the default, enter an annotation like this:
height of any data-point = 10;
width of any data-point = 10;
![]() |
Defining a Chart's Indicator Type
The Indicator attribute defines what G2 displays at each data point in a data series. The next table lists the possible values for this attribute and the chart style they are appropriate for.
| Indicator value | Column chart style | Scatter chart style |
|---|---|---|
|
Square
|
|
![]() |
|
Rectangle
|
|
![]() |
|
Triangle
|
|
![]() |
|
Cross
|
|
![]() |
|
X
|
|
![]() |
|
Bar
|
![]() |
|
|
Column
|
![]() |
|
|
Solid-bar
|
![]() |
|
|
Solid-column
|
![]() |
|
Hint: Adding an indicator annotation to a line-chart effectively changes the chart style to a column- or scatter-chart, depending on the value you specify.
Here are examples of an indicator of bar and solid-bar.
![]() |
The next diagram shows a column chart with solid-column data-point indicators for two data series. The chart appears with upper and lower values since the list element values it represents are in opposite numeric ranges (random 10 to 20, and random -20 to -10).
![]() |
Here are examples of each of the indicator attribute values appropriate for scatter charts:
![]() |
As the previous table notes, indicator attribute values are appropriate for scatter or column chart types. The term appropriate, however, does not indicate that each value is exclusive to a chart type. On the contrary, changing the
indicator attribute on a scatter or column chart effectively changes the chart style. bar). The right-hand chart shows the effect of adding the annotation:
the indicator of any data-point is square
![]() |
You can specify a separate indicator for each data series on the chart, but only one indicator can be in effect at a time. If a chart includes one indicator annotation and you add another, closing the edit on the change causes G2 to delete the first annotation and keep the last change.
the indicator of any data-point is rectangle
the indicator of any data-point is bar-column
Indicator-visible attribute specifies whether the indicator is visible. By default, an indicator is visible (true). Changing the Indicator-visible attribute to false effectively hides the data-series display. For example:
the indicator-visible of any data-point of data-series 1 is true
Connection-line-visible attribute specifies whether there is a line between data-points in a data series. You can set this attribute to true or false. The Connection-line-visible attribute is not applicable to column charts. An example of this annotation is:
the connection-line-visible of any data-point is true
true by default. Changing it to false effectively hides all data points. The next diagram shows the effect of changing the
Connection-line-visible attribute to true upon a scatter chart.
![]() |
Controlling Connecting Lines
The Line-from-last-first-point-visible attribute controls the appearance of a single connecting line from the last point in the data series to the first point. Use this when plotting data that samples one cycle of a cyclic process. Set this attribute to true or false. An example is:
the line-from-last-to-first-point-visible of any data-point is false
Line-color attribute is applicable to several components, including the chart's axis, data point and data series components. You can specify the line color for a chart component attribute as a color or a meta-color as follows:
the line-color of axis 1 is purple;
the line-color of data-series 1 is red;
the line-color of any data-point is brown