Skip to main content
A line chart shows trends over time. Use variant="categorical": the Anvil2 line variable order follows that palette, and the pale patterned monochrome steps are fill treatments that a stroke cannot carry. Limit a line chart to six series, which matches the marker shape sequence and the Anvil2 clarity guidance.

Minimal option

Define structure and data in the option. Colors and markers come from variant.

Variant styling

variant applies the following treatment: Pass variant="categorical" rather than authoring symbol or symbolSize lists. Avoid variant="monochrome" on a line chart, because the pale upper steps lose contrast against a light surface.

Dotted and dashed strokes

A solid stroke represents actual values, and a dotted or dashed stroke represents a target, forecast, or comparison. Keep variant="categorical" for color and set lineStyle.type to "dotted" or "dashed" on the series that needs it. A consumer-defined lineStyle merges with the variant’s stroke color.

Tooltips

Pass renderTooltip to add hover content. See Chart component. A line with markers reports the single point under the pointer, and a line without markers reports the whole category.
Last modified on August 20, 2026