The LineCategoryChart
component displays multiple line series categorized by a secondary key, allowing you to compare trends across distinct groups (categories) along a shared axis of discrete labels.
It is ideal for grouped comparisons across labeled segments (e.g., departments, months, stages) and is especially useful for showing how each category's values evolve over the same set of labels.
In this example, different departments (Production
, Marketing
, Finance
) are plotted along the X-axis, and each product category (Gizmos
, Gadgets
, Widgets
) is represented by its own line.
labelOnYAxis?: boolean
true
, the category labels (e.g., "Production", "Marketing") are displayed on the Y-axis, and the lines are drawn horizontally.false
(default), labels are on the X-axis, and lines are rendered vertically.marks: Array<object>
(required)Each item defines a data point on the chart. It must include:
label: string | Date
The shared axis label (e.g., phase, department, month) across which each line progresses.
value: number
The value to be plotted at that label for the corresponding category.
category: string
Defines the group to which this point belongs. Each category
generates its own line.
Additional fields from ChartMarkProps
may also be used for styling (e.g., foregroundStyle
, symbol
, annotation
).
LineCategoryChart
is useful for: