Line Chart Customisation

In addition to the general chart customisations and cartesian chart customisations, you can also use these customisations for line charts.

Option Interfaces

interface LineChartOptions { seriesDefaults: { // The fill colours are used by the lines in the series // Will be used for markers as well, unless overridden in the marker options fill: FillOptions; // The stroke colours to be used by the series' markers, unless overridden in // the marker options stroke: StrokeOptions; // The style to apply to a marker when it is hovered over or tapped highlightStyle: HighlightOptions; marker: MarkerOptions; // Configures the tooltip for bars when they are hovered over or tapped tooltip: TooltipOptions; }; } interface FillOptions { colors: string[]; // default: <dependent on selected palette> // Valid range from 0 (transparent) to 1 (opaque) opacity: number; // default: 1 } interface StrokeOptions { colors: string[]; // default: <dependent on selected palette> // Valid range from 0 (transparent) to 1 (opaque) opacity: number; // default: 1 width: number; // default: 3 } interface HighlightOptions { fill: string; // default: 'yellow' stroke?: string; } interface MarkerOptions { enabled: boolean; // default: true type: MarkerType; // default: 'circle' size: number; // default: 6 strokeWidth: number; // default: 1 } type MarkerType = 'circle' | 'cross' | 'diamond' | 'plus' | 'square' | 'triangle'; interface TooltipOptions { enabled: boolean; // default: true renderer?: (params: LineTooltipRendererParams) => string; // should return a valid HTML string } interface LineTooltipRendererParams { // The datum object for the highlighted marker that the tooltip is being rendered for datum: any; // The key of the datum object that contains the X value xKey: string; // The name of the column that the X value is from xName: string; // The key of the datum object that contains the Y value yKey: string; // The name of the column that the Y value is from yName: string; // The title of the series the datum is in title?: string; // The fill colour of the series the datum is in color: string; }

Example: Line 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!