Information on this website refers to a deprecated product, and is provided only for historical reference. Please use the Version Switcher above to select an appropriate documentation website for the product you are using.

CategoryAxis

Type class

CategoryAxis is the class which displays category axis for the Serial Chart. The chart can have only one category axis. If you do not add category axis to the Serial chart, it will be created automatically.

Inheritance

CategoryAxis extends AxisBase.

CategoryAxis is not extended by any other symbol.

Properties

boldPeriodBeginning
#

Type boolean

Default true

When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold. Set this to false to disable the functionality.

categoryFunction
#

Type Function

specifies a method that returns the value that should be used as categoryValue for current item. If this property is set, the return value of the custom data function takes precedence over categoryField. When a chart calls this method, it passes category value, data item from chart's data provider and reference to categoryAxis: categoryFunction(category, dataItem, categoryAxis); This method can be used both when category axis parses dates and when it doesn't. If axis parses dates, your categoryFunction should return Date object. For example, if you have date strings in your data, you can use this method to convert these strings into Date objects.

centerLabelOnFullPeriod
#

Type boolean

Default true

This setting works only when parseDates is set to true and equalSpacing is set to false. In case you set it to false, labels will never be centered between grid lines.

dateFormats
#

Type array

Default [{
  period:'fff',
  format:'JJ:NN:SS'
}, {
  period:'ss',
  format:'JJ:NN:SS'
}, {
  period:'mm',
  format:'JJ:NN'
}, {
  period:'hh',
  format:'JJ:NN'
}, {
  period:'DD',
  format:'MMM DD'
}, {
  period:'WW',
  format:'MMM DD'
}, {
  period:'MM',
  format:'MMM'
}, {
  period:'YYYY',
  format:'YYYY'
}]

Date formats of different periods. Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, WW - weeks, YYYY - years. Check this page for date formatting strings.

equalSpacing
#

Type boolean

Default false

In case your category axis values are Date objects and parseDates is set to true, the chart will parse dates and will place your data points at irregular intervals. However if you want dates to be parsed (displayed on the axis, baloons, etc), but data points to be placed at equal intervals (omiting dates with no data), set equalSpacing to true.

forceShowField
#

Type string

Field in data provider which specifies if the category value should always be shown. For example: categoryAxis.forceShowField = "forceShow";

And in data:

{category:"one", forceShow:true, value:100} Note, this works only when parseDates is set to false.

gridPosition
#

Type string

Default middle

Specifies if a grid line is placed on the center of a cell or on the beginning of a cell. Possible values are: "start" and "middle" This setting doesn't work if parseDates is set to true.

labelFunction
#

Type Function

You can use this function to format Category axis labels. If this function is set, then it is called with the following parameters passed:

if dates are not parsed:

labelFunction(valueText, serialDataItem, categoryAxis) if dates are parsed:

labelFunction(valueText, date, categoryAxis) Your function should return string which will be displayed on the axis.

markPeriodChange
#

Type boolean

Default true

If you set it to false, the start of longer periods won't use a different date format and won't be bold.

minPeriod
#

Type string

Default DD

Specifies the shortest period of your data. This should be set only if parseDates is set to "true". Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years.

It's also possible to supply a number for increments, i.e. "15mm" which will instruct the chart that your data is supplied in 15 minute increments.

parseDates
#

Type boolean

Default false

In case your category axis values are Date objects, set this to true. In this case the chart will parse dates and will place your data points at irregular intervals. If you want dates to be parsed, but data points to be placed at equal intervals, set both parseDates and equalSpacing to true.

startOnAxis
#

Type boolean

Default false

Specifies whether the graph should start on axis or not. In case you display columns, it is recommended to set this to false. If parseDates is set to true, startOnAxis will allways be false, unless equalSpacing is set to true.

autoGridCount
#

Type boolean

Default true

Inherited from AxisBase

Specifies whether number of gridCount is specified automatically, acoarding to the axis size.

axisAlpha
#

Type number

Default 1

Inherited from AxisBase

Axis opacity. Value range is 0 - 1.

axisColor
#

Type string

Default #000000

Inherited from AxisBase

Axis color.

axisThickness
#

Type number

Default 1

Inherited from AxisBase

Thickness of the axis.

color
#

Type string

Default

Inherited from AxisBase

Color of axis value labels. Will use chart's color if not set.

dashLength
#

Type number

Default 0

Inherited from AxisBase

Length of a dash. 0 means line is not dashed.

fillAlpha
#

Type number

Default 0

Inherited from AxisBase

Fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.

fillColor
#

Type string

Default #FFFFFF

Inherited from AxisBase

Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.

fontSize
#

Type number

Default

Inherited from AxisBase

Size of value labels text. Will use chart's fontSize if not set.

gridAlpha
#

Type number

Default 0.2

Inherited from AxisBase

Opacity of grid lines.

gridColor
#

Type string

Default #000000

Inherited from AxisBase

Color of grid lines.

gridCount
#

Type number

Default 5

Inherited from AxisBase

Number of grid lines. In case this is value axis, or your categoryAxis parses dates, the number is approximate. The default value is 5. If you set autoGridCount to true, this property is ignored.

gridThickness
#

Type number

Default 1

Inherited from AxisBase

Thickness of grid lines.

guides
#

Type array

Default

Inherited from AxisBase

The array of guides belonging to this axis.

ignoreAxisWidth
#

Type boolean

Default false

Inherited from AxisBase

If autoMargins of a chart is set to true, but you want this axis not to be measured when calculating margin, set ignoreAxisWidth to true.

inside
#

Type boolean

Default false

Inherited from AxisBase

Specifies whether values should be placed inside or outside plot area.

labelFrequency
#

Type number

Default 1

Inherited from AxisBase

Frequency at which labels should be placed. Doesn't work for CategoryAxis if parseDates is set to true.

labelRotation
#

Type number

Default 0

Inherited from AxisBase

Rotation angle of a label. Only horizontal axis' values can be rotated. If you set this for vertical axis, the setting will be ignored.

labelsEnabled
#

Type boolean

Default true

Inherited from AxisBase

Specifies whether axis displays category axis' labels and value axis' values.

offset
#

Type number

Default 0

Inherited from AxisBase

The distance of the axis to the plot area, in pixels. Negative values can also be used.

position
#

Type string

Default

Inherited from AxisBase

Possible values are: "top", "bottom", "left", "right". If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom".

showFirstLabel
#

Type boolean

Default true

Inherited from AxisBase

Whether to show first axis label or not.

showLastLabel
#

Type boolean

Default true

Inherited from AxisBase

Whether to show last axis label or not.

tickLength
#

Type number

Default 5

Inherited from AxisBase

Length of the tick marks.

title
#

Type string

Default

Inherited from AxisBase

Title of the axis.

titleBold
#

Type boolean

Default true

Inherited from AxisBase

Specifies if title should be bold or not.

titleColor
#

Type string

Default

Inherited from AxisBase

Color of axis title. Will use text color of chart if not set any.

titleFontSize
#

Type number

Default

Inherited from AxisBase

Font size of axis title. Will use font size of chart plus two pixels if not set any.

There are 28 inherited items currently hidden from this list.

Methods

addGuide(
  guide
)

#

Returns void

Inherited from AxisBase

Adds guide to the axis.

guide - instance of Guide

categoryToCoordinate(
  category
)

#

Returns Number

returns coordinate of a category. Works only if parseDates is false. If parseDates is true, use dateToCoordinate method.

category - String

coordinateToDate(
  coordinate
)

#

Returns date - Date object

Returns Date of the coordinate, in case parseDates is set to true and equalSpacing is set to false.

coordinate - Number

dateToCoordinate(
  date
)

#

Returns Number

Returns coordinate of the date, in case parseDates is set to true. if parseDates is false, use categoryToCoordinate method.

date - Date object

removeGuide(
  guide
)

#

Returns void

Inherited from AxisBase

Removes guide from the axis.

guide - instance of Guide

xToIndex(
  x
)

#

Returns Number

Returns index of the category which is most close to specified coordinate.

x - coordinate

There are 2 inherited items currently hidden from this list.

Events

CategoryAxis does not have any events.

Adapters

CategoryAxis does not have any adapters.