Cartesian Chart Customisation
In addition to the general chart customisations, you can also use these customisations for cartesian charts, which have an x- and y-axis.
Option Interfaces
Example: Cartesian Chart Customisations
The example below changes all available styling options. The styling options are exaggerated to demonstrate each option rather than to produce a chart that looks nice!
Axis Types
Charts can use different types of axes to present data in different ways. The grid will select best-guess defaults based on the type of chart,
the column chart data types, and the data being plotted. If required,
you can override the default axis types for line and scatter/bubble charts by setting the type in the relevant
AxisOptions object.
There are three types of axis available: 'category', 'number' and 'time'.
Category
This is a discrete axis used for showing data based on a collection of categories. It is used automatically for'category'
columns. If no category column is selected and this axis is used, default category names will be created using an ascending numeric sequence.
Number
This is a continuous axis used for plotting numerical values. It is used automatically for'series' columns that contain
number values.
Time
This is a continuous axis used for plotting date/time values. It is used automatically in line and scatter/bubble charts for columns that containDate values. Use of this type of axis allows the creation of time series charts.
Format String
For time axes, a format string can be provided, which will be used to format the data for display as axis labels. The format string may contain the following directives, which reflect those from Python's strftime:
%a- abbreviated weekday name.*%A- full weekday name.*%b- abbreviated month name.*%B- full month name.*%c- the locale’s date and time, such as%x,%X.*%d- zero-padded day of the month as a decimal number[01,31].%e- space-padded day of the month as a decimal number[ 1,31]; equivalent to%_d.%f- microseconds as a decimal number[000000,999999].%H- hour (24-hour clock) as a decimal number[00,23].%I- hour (12-hour clock) as a decimal number[01,12].%j- day of the year as a decimal number[001,366].%m- month as a decimal number[01,12].%M- minute as a decimal number[00,59].%L- milliseconds as a decimal number[000,999].%p- either AM or PM.*%Q- milliseconds since UNIX epoch.%s- seconds since UNIX epoch.%S- second as a decimal number[00,61].%u- Monday-based (ISO) weekday as a decimal number[1,7].%U- Sunday-based week of the year as a decimal number[00,53].%V- ISO 8601 week number of the year as a decimal number[01, 53].%w- Sunday-based weekday as a decimal number[0,6].%W- Monday-based week of the year as a decimal number[00,53].%x- the locale’s date, such as%-m/%-d/%Y.*%X- the locale’s time, such as%-I:%M:%S %p.*%y- year without century as a decimal number[00,99].%Y- year with century as a decimal number.%Z- time zone offset, such as-0700,-07:00,-07, orZ.%%- a literal percent sign (%).
Directives marked with an asterisk (*) may be affected by the locale definition.
For %U, all days in a new year preceding the first Sunday are considered to be in week 0.
For %W, all days in a new year preceding the first Monday are considered to be in week 0.
For %V, per the strftime man page:
In this system, weeks start on a Monday, and are numbered from 01, for the first week, up to 52 or 53, for the last week.
Week 1 is the first week where four or more days fall within the new year (or, synonymously,
week 01 is: the first week of the year that contains a Thursday; or, the week that has 4 January in it).
The % sign indicating a directive may be immediately followed by a padding modifier:
0- zero-padding_- space-padding- (nothing) - disable padding
0 for all directives except %e, which defaults to _.
Example: Time Series Chart
This example shows how a time series chart can be created. It demonstrates explicitly setting the axis type to 'time',
but you can also remove this and the chart will still use the time axis as it automatically detects the axis type from the data in the
Date column.