Class CategoryAxis

AxisBase is the base class for ValueAxis and CategoryAxis. It can not be instantiated explicitly.

Hierarchy

Index

Properties

Methods

Properties

public autoGridCount: boolean

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

default

true

public axisAlpha: number

Axis opacity. Value range is 0 - 1.

default

1

public axisColor: string

Axis color. #000000

public axisThickness: number

Thickness of the axis.

default

1

public boldPeriodBeginning: boolean

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.

default

true

public color: string

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

public dashLength: number

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

public dateFormats: Array<any>

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. [{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'}]

public equalSpacing: boolean

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.

public fillAlpha: number

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.

public fillColor: string

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. #FFFFFF

public fontSize: number

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

public forceShowField: string

Field in data provider which specifies if the category value should always be shown. For example: categoryAxis.forceShowField = "forceShow"; 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.

public gridAlpha: number

Opacity of grid lines. 0.2

public gridColor: string

Color of grid lines. #000000

public gridCount: number

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.

default

5

public gridPosition: string

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. middle

public gridThickness: number

Thickness of grid lines.

default

1

public guides: Array<any>

The array of guides belonging to this axis.

public ignoreAxisWidth: boolean

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.

public inside: boolean

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

public labelFrequency: number

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

default

1

public labelRotation: number

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

public labelsEnabled: boolean

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

default

true

public minPeriod: string

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. DD

public offset: number

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

public parseDates: boolean

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.

public position: string

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

public showFirstLabel: boolean

Whether to show first axis label or not.

default

true

public showLastLabel: boolean

Whether to show last axis label or not.

default

true

public startOnAxis: boolean

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.

public tickLength: number

Length of the tick marks.

default

5

public title: string

Title of the axis.

public titleBold: boolean

Specifies if title should be bold or not.

default

true

public titleColor: string

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

public titleFontSize: number

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

Methods

public addGuide(guide: Guide): any

Adds guide to the axis.

Parameters

Returns

any

public categoryToCoordinate(category: any): any

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

Parameters

  • category: any

Returns

any

public coordinateToDate(coordinate: any): any

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

Parameters

  • coordinate: any

Returns

any

public dateToCoordinate(date: any): any

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

Parameters

  • date: any

Returns

any

public removeGuide(guide: Guide): any

Removes guide from the axis.

Parameters

Returns

any

public xToIndex(x: any): any

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

Parameters

  • x: any

Returns

any