SparkLineChart API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import SparkLineChart from '/packages/x-charts/src/SparkLineChart';
// or
import { SparkLineChart } from '/packages/x-charts/src';
Props
Set to true
to highlight the value. With line, it shows a point. With bar, it shows a highlight band.
Type:
bool
Formatter used by the tooltip.
Type:
func
Signature:
function(value: number) => string
value
The value to format.
Returns: the formatted value.
The xAxis configuration. Notice it is a single configuration object, not an array of configuration.
Type:
{ axisId?: string, classes?: object, data?: array, dataKey?: string, disableLine?: bool, disableTicks?: bool, fill?: string, hideTooltip?: bool, id?: string, label?: string, labelFontSize?: number, max?: Date | number, min?: Date | number, position?: 'bottom' | 'left' | 'right' | 'top', scaleType?: 'band' | 'linear' | 'log' | 'point' | 'pow' | 'sqrt' | 'time' | 'utc', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickSize?: number, valueFormatter?: func }
The component cannot hold a ref.