Skip to content

Line chart

D3 chart

For all common D3 chart properties, refer to D3 chart API.

Chart.Line

js
import { Chart } from '@semcore/ui/d3-chart';

LineChartProps

BaseChartProps<> & {...}
NameTypeDescription
groupKeystring Field name that groups the data points
areaRecord<, []> Optional area data for rendering filled areas under lines
xScaleScaleLinear<any, any> | ScaleTime<any, any> Custom x-axis scale
yScaleScaleLinear<any, any> Custom y-axis scale
showDotsboolean Controls whether to display dots on the line chart
curve D3 curve factory for line interpolation
areaCurve Curve factory specifically for area rendering
onClickLine(index: number, event: React.SyntheticEvent) => void Callback triggered when a user clicks on a line

Line

It have children components Dots, Null.

js
import { Line } from '@semcore/ui/d3-chart';

<Line>
  <Line.Dots />
  <Line.Null />
</Line>;

LineProps

& {...}
NameTypeDescription
xstring Field name from `data` array item for the XAxis
ystring Field name from `data` array item for the YAxis
colorstring Line color
hideboolean Element hide property
curve Curve method
durationnumber Animation duration in ms
transparentboolean Enables element transparency
patterns Enables charts patterns that enhances charts accessibility
onClick(index: number, event: React.SyntheticEvent) => void Callback triggered when a user clicks on a line

Released under the MIT License.

Released under the MIT License.