@spaced-out/ui-design-system
Version:
Sense UI components library
52 lines (48 loc) • 1.08 kB
Flow
// @flow strict
import {colorBorderPrimary} from '../../styles/variables/_color.js';
import type {ChartOptions} from '../../types/charts';
import {commonChartOptions} from './charts';
import {
bottomLegendRow,
xAxisTitleStyle,
yAxisLabelStyle,
yAxisTitleStyle,
} from './helpers';
import {formLabelSmall} from './typography';
/**
* This function modifies the the common chart behavior to line chart default behavior.
* It will not take userPassed option into account.
*/
export const getLineChartOptions = (): ChartOptions => ({
...commonChartOptions,
chart: {
type: 'line',
},
legend: {
...commonChartOptions.legend,
...bottomLegendRow,
symbolWidth: 18,
},
xAxis: {
...commonChartOptions.xAxis,
labels: {
style: formLabelSmall,
},
title: {
margin: 12,
style: xAxisTitleStyle,
},
lineColor: colorBorderPrimary,
},
yAxis: {
labels: {
align: 'right',
distance: 12,
style: yAxisLabelStyle,
},
title: {
margin: 12,
style: yAxisTitleStyle,
},
},
});