xaxis
Configuration Structure
xaxis: {}type
'category'Available Options: category, datetime, numeric
categories
Labels which are displayed on the x-axis.
tickAmount
undefinedNumber of Tick Intervals to show. Note: tickAmount doesn't affect datetime xaxis types. For numeric axes, use tickAmount: 'dataPoints' to match dataPoint counts.
tickPlacement
'on'Whether to draw the ticks in between the data-points or on the data-points. Options: between or on. Note: applies only to category type charts.
min
undefinedThe lowest number to be set for the x-axis. The graph drawing beyond this number will be clipped off.
max
undefinedThe highest number to be set for the x-axis. The graph drawing beyond this number will be clipped off.
stepSize
undefinedThe interval between consecutive values on an x-axis. It determines how the values on the axis are spaced or displayed.
range
undefinedTakes the max value of x-axis, subtracts the provided range value and gets the min value based on that. So, technically it helps to keep the same range when min and max values gets updated dynamically.
floating
falseSetting this options takes the y-axis out of the plotting area. Much behaves like position: absolute property of CSS.
decimalsInFloat
undefinedThe number of fractions to display when there are floating values on the x-axis numbers. Applicable only for numeric type.
overwriteCategories
undefinedAllows you to overwrite all the labels of the x-axis with these labels. Accepts an array of string values.
position
'bottom'Change the x-axis position. Available options: bottom, top.
show
trueShow labels on x-axis.
rotate
-45Rotate angle for the x-axis labels.
rotateAlways
falseWhether to rotate the labels always or to rotate only when the texts don't fit the available width.
hideOverlappingLabels
trueWhen labels are too close and start to overlap on one another, this option prevents overlapping of the labels.
showDuplicates
trueBy default, duplicate labels are not printed to prevent congested values in a datetime series. If you intentionally want to display the same values in x-axis labels, turn on this option.
trim
falseAppend ... to the text when it can't fit the available space and rotate is turned off.
minHeight
undefinedMinimum height for the labels.
maxHeight
120Maximum height for the labels when they are rotated.
colors
[]ForeColor for the x-axis label. Accepts an array for distributed charts or accepts a single color string.
fontSize
'12px'FontSize for the x-axis label.
fontFamily
undefinedFontFamily for the x-axis label.
fontWeight
400Font-weight for the x-axis label.
cssClass
''A custom Css Class to give to the label elements.
offsetX
0Sets the left offset for label.
offsetY
0Sets the top offset for label.
format
undefinedFormats the datetime value based on the format specifier.
formatter
undefinedOverrides everything and applies a custom function for the xaxis value. The function accepts 3 arguments. The first one is the default formatted value and the second one as the raw timestamp which you can pass to any datetime handling function to suit your needs. The 3rd argument is present in date-time xaxis which includes a dateFormatter.
xaxis: {
labels: {
formatter: function(value, timestamp, opts) {
return opts.dateFormatter(new Date(timestamp)).format("dd MMM")
}
}
}
datetimeUTC
trueWhen turned on, local DateTime is converted into UTC. Turn it off if you supply date with timezone info and want to preserve it.
year
'yyyy'Format specifier for the year.
month
"MMM 'yy"Format specifier for the month.
day
'dd MMM'Format specifier for the day of month.
hour
'HH:mm'Format specifier for the hour of day.
minute
'HH:mm:ss'Format specifier for minutes.
second
'HH:mm:ss'Format specifier for seconds.
groups
groups: [{
title: "ABC",
cols: 3
}, {
title: "XYZ",
cols: 4
}]
colors
ForeColor for the x-axis groups label.
fontSize
FontSize for the x-axis group label.
fontWeight
Font-weight for the x-axis group label.
fontFamily
FontFamily for the x-axis group label.
cssClass
A custom Css Class to give to the label elements.
show
trueDraw a horizontal border on the x-axis.
color
'#e0e0e0'Color of the horizontal axis border.
height
1Sets the border height of the xaxis line.
offsetX
0Sets the left offset of the axis border.
offsetY
0Sets the top offset of the axis border.
show
trueDraw ticks on the x-axis to specify intervals.
borderType
Available Options: solid, dotted.
color
'#e0e0e0'Color of the ticks.
height
6Height of the ticks.
offsetX
0Sets the left offset of the ticks.
offsetY
0Sets the top offset of the ticks.
text
undefinedGive the x-axis a title which will be displayed below the axis labels by default.
offsetX
0Sets the left offset for xaxis title.
offsetY
0Sets the top offset for the xaxis title.
color
undefinedForeColor of the x-axis title.
fontSize
'12px'FontSize for the x-axis title.
fontFamily
undefinedFontFamily for the x-axis title.
fontWeight
900Font-weight for the x-axis title.
cssClass
''A custom Css Class to give to the x-axis title.
show
trueShow crosshairs on x-axis when user moves the mouse over chart area.
width
1Possible Options: Any number, tickWidth (uses tick intervals), barWidth (vertical bar charts only).
position
'back'Possible Options: back, front.
opacity
0.9Opacity of the crosshairs.
color
'#b6b6b6'Border Color of crosshairs.
width
1Border Width of crosshairs.
dashArray
3Creates dashes in borders of crosshairs. A higher number creates more space between dashes in the border.
type
'solid'Possible Options: solid, gradient.
color
'#B1B9C4'Fill color of crosshairs.
colorFrom
'#D8E3F0'Crosshairs Gradient Color from.
colorTo
'#BED1E6'Crosshairs Gradient Color to.
stops
[0, 100]Stops defines the ramp of colors to use on a gradient.
opacityFrom
0.4Crosshairs fill opacity from.
opacityTo
0.5Crosshairs fill opacity to.
enabled
falseEnable a dropshadow for crosshairs.
top
0Set top offset for shadow.
left
0Set left offset for shadow.
blur
1Set blur distance for shadow.
opacity
0.8Set the opacity of shadow.
enabled
trueShow tooltip on x-axis or not.
formatter
undefinedA custom formatter function for the x-axis tooltip label. If undefined, the xaxis tooltip uses the default "X" value used in general tooltip.
xaxis: {
tooltip: {
formatter: function(val, opts) {
return val + "..."
}
}
}
offsetY
0Sets the top offset for x-axis tooltip.
fontSize
'12px'FontSize for the x-axis tooltip text.
fontFamily
undefinedFontFamily for the x-axis tooltip text.