Map chart
A choropleth and point map on vector outlines, drawn by ECharts: regions shaded by a value, with layers of sized points and flow lines, on the bundled world and US maps or your own GeoJSON, TopoJSON or SVG.
c2-map-chart
A choropleth and point map drawn by ECharts on vector outlines: regions shaded by a value, with optional layers of
sized points and flow lines on top. The world (world-110m, world-50m) and US states (us-states) maps ship
with the package and load only when named; geo or src draws any GeoJSON, TopoJSON or SVG instead.
<c2-map-chart region-field="country" value-field="revenue" value-label="Revenue"
data='[{ "country": "BRA", "revenue": 1270 }, { "country": "DEU", "revenue": 2210 }]'>
</c2-map-chart>
Rows join regions through region-field, whose values are read against the map's region-key: ISO 3166-1
alpha-3 codes on the world maps (iso_a2, id for the numeric code and name also work), USPS codes on
us-states. Rows that match no region are reported by unmatched-rows. Regions without a row keep
--c2-chart__region--background-color and are listed as "No data" in the legend.
scale picks a sequential ramp or a diverging one around a midpoint; thresholds turns either into stepped classes.
c2-map-layer children add points and lines, each with its own data and legend entry. selection makes the
regions selectable, as a form control whose value is the selected keys.
Unlike the other charts, a data change rebuilds the engine options, because region colours are options rather than series data. Maps are not a streaming chart.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
map | MapName | world-110m | A bundled map: world-110m (the default), world-50m or us-states. Ignored when geo or src is set. |
src | string | — | URL of a GeoJSON, TopoJSON or SVG file to draw instead of a bundled map. |
region-key | string | — | Feature property a row's region-field is matched against. Defaults to the map's own key: iso_a3 on the world
maps, postal on us-states, and id on your own GeoJSON. An SVG's regions are its elements' ids. |
region-field | string | — | Row field naming each row's region. |
value-field | string | — | Row field holding the value regions are shaded by. Without it the regions are drawn plain. |
value-label | string | — | Names the value in the tooltip and the colour key. Defaults to the humanized value-field. |
unit | string | — | Text appended to every formatted value, such as % or °C. |
projection | MapProjection | undefined | — | How longitude and latitude become the plane. Defaults to the map's own: Equal Earth for the world, Albers USA for
us-states, Mercator for your own GeoJSON and none for an SVG, whose coordinates are drawn as they are. |
scale | 'sequential' | 'diverging' | sequential | sequential shades from light to dark; diverging runs two hues out from a neutral midpoint. |
domain | number[] | undefined | — | The values the scale's ends sit at: [min, max], or [min, mid, max] for a diverging scale. Defaults to the data's
extent, and for a diverging scale to a range symmetric around 0. |
thresholds | number[] | undefined | — | Class breaks, such as [-10, -5, 0, 5, 10], which turn the scale into stepped classes. A value equal to a break is in the upper class. |
scale-colors | string[] | undefined | — | One colour per class of a stepped scale, overriding the ramp: ["#16a34a", "#d97706", "#dc2626"]. |
scale-labels | string[] | undefined | — | One name per class of a stepped scale, shown in the colour key instead of the break values. |
roam | 'none' | 'zoom' | 'pan' | 'both' | none | How the reader moves the map. zoom shows zoom buttons and lets a zoomed map be dragged; pan allows dragging
only; both adds the mouse wheel and pinch, which then no longer scroll the page. |
max-zoom | number | 8 | The largest zoom factor the reader can reach. |
extent | string | — | The area the map is fitted to: region keys ("FRA DEU ITA"), a named area (europe, africa, asia,
middle-east, north-america, south-america, oceania), or a [west, south, east, north] box in degrees. |
selection | 'none' | 'single' | 'multiple' | none | Whether clicking a region selects it: single keeps one region selected, multiple toggles each one. |
value | string[] | [] | Keys of the selected regions. As an attribute, separated by semicolons: value="FRA;DEU". |
name | string | — | Form field name. The form receives one entry per selected region. |
renderer | 'canvas' | 'svg' | canvas | Which ECharts renderer to use. SVG prints and scales crisply; canvas is faster with many marks. |
data | ChartInput | undefined | — | The data to plot. Row objects, a bare number[], columnar [xs, ys…], or an already-normalised
frame. Compared by identity: replace the array, or bump revision after mutating it in place. |
revision | number | 0 | Bump after mutating data in place. The cheap escape hatch for a large buffer you own. |
series | ChartSeriesConfig[] | undefined | — | Series definitions, as an alternative to c2-chart-series children. Children win when both are set. |
x-field | string | — | Row field holding the x value; may be a dotted path. Defaults to the row index. |
label-field | string | — | Row field holding each row's label: the slice names of a pie, the category axis of a bar chart, and the x tick
labels of a line, area or sparkline chart (label-field="month", or "year" to print 2021 rather than 2,021). |
x-type | 'time' | 'linear' | 'category' | linear | How x values are interpreted, which decides the axis and the tooltip format. |
legend | 'none' | 'top' | 'bottom' | 'start' | 'end' | bottom | Where the legend sits, or none to hide it. Shown by default: a chart with more than one series is
unreadable without one, and a single-series chart simply renders a one-entry legend. |
legend-action | 'toggle' | 'highlight' | highlight | What clicking a legend entry does. highlight (the default) emphasises the series and dims the others, and a
second click clears the highlight, just as a click on the series in the plot does; toggle hides or shows the
series instead. A linked c2-chart-legend follows the same mode. |
highlighted | string | null | null | Key of the series drawn emphasised, the others dimmed: the series field, or a pie's slice label, or an overlap
chart's set key. Set by a legend click in highlight mode, and settable from the application in either mode. |
tooltip | 'none' | 'item' | 'axis' | axis | Whether the tooltip follows the whole x position or only the hovered datum. |
animation | 'none' | 'auto' | auto | Whether the chart animates its initial draw. ECharts uses its native shape animation and uPlot uses a
lightweight plot reveal; subsequent data updates stay immediate so a live source does not animate
every tick. Named animation rather than animate because HTMLElement.animate() is a method every
element already has, and shadowing it breaks the Web Animations API on the host. |
locale | string | undefined | — | BCP 47 locale for the axis and tooltip formatting. Defaults to the browser locale. |
loading | boolean | false | Shows the loading state instead of the plot. |
error | string | — | Shows an error message instead of the plot. |
empty-message | string | No data | Replaces the built-in "no data" text. |
max-points | number | 0 | Caps how many points a streaming chart keeps; older points fall off the front. 0 keeps everything. |
lazy-render | boolean | false | Defers loading the engine until the host first scrolls into view. |
annotations | ChartAnnotation[] | undefined | — | Markers at an x value and shaded x ranges, drawn over the plot of a cartesian chart (line, area, bar, sparkline,
scatter, bubble, candlestick) and placed by the engine's own x scale, so they follow the axes, a resize and a
zoom. x/x2 are x values: what x-field holds (epoch milliseconds on a time chart), else the row index. Each
marker is a button, reachable with Tab and named by its label and x, that fires annotation-click. The
other charts (pie, gauge, radar, pyramid, butterfly, heatmap, overlap, chord, map) ignore it. |
Slots
| Name | Description |
|---|---|
default | The series definitions: c2-chart-series elements. They render nothing themselves. |
legend | Replaces the built-in legend. The built-in one is still what legend positions. |
tooltip | Replaces the built-in tooltip body. The hovered point is available through the renderTooltip property when a function is easier than markup. |
actions | Controls pinned to the top-right of the plot area, for a range picker or an export button. |
empty | Replaces the built-in "no data" message. |
loading | Replaces the built-in message shown while loading is set. |
error | Replaces the built-in message shown when error is set. |
Events
| Name | Type | Description |
|---|---|---|
unmatched-rows | CustomEvent<MapUnmatchedRowsEventDetail> | Fired after the data or the map changes when some rows name no region of the map. detail.keys lists them. Does not bubble. |
view-change | CustomEvent<MapViewChangeEventDetail> | Fired after the reader zooms or pans, or a zoom button is pressed. detail.bounds is the visible area in degrees. Does not bubble. |
selection-change | CustomEvent<MapSelectionChangeEventDetail> | Fired after the reader selects or deselects a region. detail.value holds the selected keys. Does not bubble. input and change fire alongside it. |
input | Event | Fired with selection-change after the reader changes the selection, for two-way bindings such as v-model. Bubbles. |
change | Event | Fired with selection-change after the reader changes the selection, as a form control does. Bubbles. |
tooltip-change | CustomEvent<ChartTooltipContext | null> | Fired with the complete tooltip model as the pointer moves, and with null when it leaves. Used by c2-chart-tooltip. |
series-toggle | CustomEvent<ChartSeriesToggleEventDetail> | Fired when a series is hidden or shown, from the legend with legend-action="toggle" or through setSeriesVisible. Does not bubble. |
series-highlight | CustomEvent<ChartSeriesHighlightEventDetail> | Fired when the reader highlights a series, from the legend or by clicking it in the plot, or clears the highlight. detail.key names it, or is null. Does not bubble. |
legend-change | CustomEvent<ChartLegendChangeEventDetail> | Fired when legend entries or visibility change. Used by c2-chart-legend. |
chart-ready | CustomEvent<{ engine: string }> | Fired after the engine has loaded and drawn for the first time. The host also matches :state(ready) from then on, which is what a test should wait on. |
chart-error | CustomEvent<{ error: unknown }> | Fired when the engine fails to load or to draw. detail.error is the underlying failure. |
range-change | CustomEvent<ChartRangeEventDetail> | Fired after the user zooms or brushes. detail.min and detail.max are the new x bounds. Does not bubble. |
point-hover | CustomEvent<ChartPointEventDetail | null> | Fired as the pointer moves between data points, and with a null detail when it leaves the plot. Does not bubble. |
annotation-click | CustomEvent<ChartAnnotationEventDetail> | Fired when an annotation's marker is clicked, or activated from the keyboard. detail.annotation is the entry and detail.index its position in annotations. Does not bubble. |
point-click | CustomEvent<ChartPointEventDetail> | Fired when a datum is clicked; the chart then highlights the clicked series (a second click on it clears the highlight). Cancelable: preventDefault() keeps the highlight as it is. Does not bubble: several components fire point events, so a listener belongs on the element itself. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
zoom-controls | The group of zoom buttons shown when roam allows zooming. |
zoom-control | One zoom button. |
scale-legend | The colour key at the end of the built-in legend. |
frame | The outer flex column holding the legend and the plot area. |
plot-area | The positioned box the engine draws into. |
plot | The engine's container element. Carries no Lit bindings, so the canvas survives every update. |
overlay | The non-interactive layer above the canvas that holds the tooltip and the actions. |
tooltip | Component-owned bubble containing the tooltip slot and its generated fallback content. |
actions | The container for the actions slot. |
annotations | The layer holding the annotations, above the plot and below the tooltip. |
annotation | One annotation: the box from x to x2, or a zero-width box at x. |
annotation-range | The shaded fill of a range annotation. |
annotation-line | The rule drawn at an annotation's x. |
annotation-marker | The focusable button at the top of an annotation's rule. |
state | Shared message layer containing the empty, loading, or error slot and its fallback state. |
legend | Component-owned container wrapping the legend slot and generated legend fallback. |
legend-item | One legend entry, a toggle button. |
legend-marker | The colour swatch inside a legend entry. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-chart--width | length | 100% | Width of the host. The plot is absolutely positioned and has no intrinsic width, so a chart used as a flex item would otherwise collapse to its legend. |
--c2-chart--height | pixel | 320px | Height of the host. A canvas has no intrinsic size, so this is what gives the chart a box. |
--c2-chart--background | color | #ffffff | Background of the chart surface. |
--c2-chart--color | color | #18181b | Primary text colour. |
--c2-chart--font-family | font-family | inherit | Font family used for the chart chrome and the labels the engine draws. |
--c2-chart--font-size | font-size | 12px | Base font size. |
--c2-chart--padding | padding | 12px | Padding around the whole chart. |
--c2-chart--border-top | border | 1px solid #e4e4e7 | Top border. |
--c2-chart--border-right | border | 1px solid #e4e4e7 | Right border. |
--c2-chart--border-bottom | border | 1px solid #e4e4e7 | Bottom border. |
--c2-chart--border-left | border | 1px solid #e4e4e7 | Left border. |
--c2-chart--border-top-left-radius | border-radius | 8px | Top-left corner radius. |
--c2-chart--border-top-right-radius | border-radius | 8px | Top-right corner radius. |
--c2-chart--border-bottom-left-radius | border-radius | 8px | Bottom-left corner radius. |
--c2-chart--border-bottom-right-radius | border-radius | 8px | Bottom-right corner radius. |
--c2-chart__region--background-color | color | #f4f4f5 | Fill of a region without data. |
--c2-chart__region--border-color | color | #ffffff | Colour of the borders between regions. |
--c2-chart__region--border-width | pixel | 0.5px | Width of the borders between regions. |
--c2-chart__region__hover--border-color | color | #18181b | Outline of the hovered region. |
--c2-chart__region__hover--border-width | pixel | 1px | Outline width of the hovered region. |
--c2-chart__region__selected--background-color | color | #dbeafe | Fill of a selected region that has no data. A region with data keeps its scale colour. |
--c2-chart__region__selected--border-color | color | #0265dc | Outline of a selected region. |
--c2-chart__region__selected--border-width | pixel | 2px | Outline width of a selected region. |
--c2-chart__scale-start--color | color | #dce8fb | Low end of a sequential scale. |
--c2-chart__scale-end--color | color | #0a3b8c | High end of a sequential scale, and positive end of a diverging one. |
--c2-chart__scale-negative--color | color | #c2410c | Negative end of a diverging scale. |
--c2-chart__scale-mid--color | color | #e4e4e7 | Neutral midpoint of a diverging scale. |
--c2-chart__scale-legend--width | length | 160px | Length of the colour key's gradient or row of classes. |
--c2-chart__marker--opacity | opacity | 0.5 | Fill opacity of a point. The outline stays opaque. |
--c2-chart__marker--border-width | pixel | 1px | Outline width of a point. |
--c2-chart__marker--min-size | pixel | 6px | Diameter of the smallest point, and of a point with no size. |
--c2-chart__marker--max-size | pixel | 40px | Diameter of the point holding a layer's largest size. |
--c2-chart__marker__hover--opacity | opacity | 0.85 | Fill opacity of the hovered point. |
--c2-chart__flow--width | pixel | 1.5px | Stroke width of a line without a width field. |
--c2-chart__flow--max-width | pixel | 6px | Stroke width of the line holding a layer's largest width value. |
--c2-chart__flow--opacity | opacity | 0.7 | Opacity of a line. |
--c2-chart__zoom-control--size | pixel | 28px | Width and height of a zoom button. |
--c2-chart__zoom-control--background-color | color | #ffffff | Background of a zoom button. |
--c2-chart__zoom-control--color | color | #18181b | Icon colour of a zoom button. |
--c2-chart__zoom-control--border | border | 1px solid #e4e4e7 | Border of a zoom button. |
--c2-chart__zoom-control--border-radius | border-radius | 6px | Corner radius of a zoom button. |
--c2-chart__zoom-control__hover--background-color | color | #f4f4f5 | Background of a hovered zoom button. |
--c2-chart__series__dimmed--opacity | opacity | 0.25 | Opacity the other series (or slices) keep while one is highlighted. |
--c2-chart__series-1--color | color | #0265dc | Colour of the first series. |
--c2-chart__series-2--color | color | #ea580c | Colour of the second series. |
--c2-chart__series-3--color | color | #0f766e | Colour of the third series. |
--c2-chart__series-4--color | color | #db2777 | Colour of the fourth series. |
--c2-chart__series-5--color | color | #a16207 | Colour of the fifth series. |
--c2-chart__series-6--color | color | #7c3aed | Colour of the sixth series. |
--c2-chart__series-7--color | color | #0891b2 | Colour of the seventh series. |
--c2-chart__series-8--color | color | #52525b | Colour of the eighth series. Series beyond the eighth reuse the palette from the start. |
--c2-chart__axis--color | color | #71717a | Colour of the axis lines and tick labels. |
--c2-chart__axis--font-size | font-size | 12px | Font size of the tick labels. |
--c2-chart__grid--color | color | #e4e4e7 | Colour of the grid lines. |
--c2-chart__crosshair--color | color | #a1a1aa | Colour of the cursor crosshair. |
--c2-chart__crosshair--width | pixel | 1px | Width of the cursor crosshair. |
--c2-chart__surface--color | color | #ffffff | Surface colour handed to the engine, for marker borders and label backdrops. |
--c2-chart__muted--color | color | #71717a | Secondary text colour. |
--c2-chart__positive--color | color | #16a34a | Colour for a rising value, used by the candlestick chart and as the sparkline's positive tone. |
--c2-chart__negative--color | color | #dc2626 | Colour for a falling value, used by the candlestick chart and as the sparkline's negative tone. |
--c2-chart__legend--gap | pixel | 12px | Gap between legend entries. |
--c2-chart__legend--padding | padding | 8px 0 0 | Padding around the legend. |
--c2-chart__legend--color | color | #71717a | Legend text colour. |
--c2-chart__legend--font-size | font-size | 12px | Legend font size. |
--c2-chart__legend__disabled--opacity | opacity | 0.38 | Opacity of the legend entries that are not highlighted while one is, or, with legend-action="toggle", of an entry whose series is hidden. |
--c2-chart__legend-marker--size | pixel | 10px | Size of the legend colour swatch. |
--c2-chart__legend-marker--border-radius | border-radius | 999px | Corner radius of the legend colour swatch. |
--c2-chart__tooltip--background-color | color | #18181b | Tooltip background. |
--c2-chart__tooltip--color | color | #fafafa | Tooltip text colour. |
--c2-chart__tooltip--font-size | font-size | 12px | Tooltip font size. |
--c2-chart__tooltip--padding | padding | 8px 10px | Tooltip padding. |
--c2-chart__tooltip--border-radius | border-radius | 6px | Tooltip corner radius. |
--c2-chart__tooltip--box-shadow | box-shadow | 0 8px 24px rgba(24, 24, 27, 0.08) | Tooltip shadow. |
--c2-chart__tooltip--gap | pixel | 6px | Gap between tooltip rows. |
--c2-chart__annotation--color | color | #71717a | Colour of a neutral annotation (the default tone). |
--c2-chart__annotation__info--color | color | #0265dc | Colour of an info annotation. |
--c2-chart__annotation__success--color | color | #16a34a | Colour of a success annotation. |
--c2-chart__annotation__warning--color | color | #d97706 | Colour of a warning annotation. |
--c2-chart__annotation__danger--color | color | #dc2626 | Colour of a danger annotation. |
--c2-chart__annotation-range--opacity | opacity | 0.12 | Opacity of the shaded fill of a range annotation. |
--c2-chart__annotation-line--border-width | pixel | 1px | Width of an annotation's rule. |
--c2-chart__annotation-line--border-style | border-style | dashed | Style of an annotation's rule. |
--c2-chart__annotation-marker--size | pixel | 10px | Diameter of an annotation's marker. |
--c2-chart__annotation-marker--border-color | color | #ffffff | Ring drawn around a marker, so it stands out from the bars or lines behind it. |
--c2-chart__annotation-marker__focus--outline | outline | 2px solid #0265dc | Focus ring of a marker. |
--c2-chart__state--color | color | #71717a | Colour of the empty, loading and error text. |
--c2-chart__state--font-size | font-size | 14px | Font size of the empty, loading and error text. |
c2-map-layer
One layer of marks drawn over a c2-map-chart's regions, declared as a light-DOM child. It renders nothing
itself: like c2-chart-series, it is a definition the map reads. Each layer has its own data and is one entry
of the map's legend.
type="points"places a circle per row atlon-field/lat-field, or at the region named byregion-field.size-fieldsizes it by area between--c2-chart__marker--min-sizeand--max-size.type="lines"draws a line per row fromfrom-fieldtoto-field. Each end is a region key or a[lon, lat]pair;width-fieldsets the stroke width up to--c2-chart__flow--max-width.
<c2-map-chart>
<c2-map-layer type="points" label="Offices" size-field="staff" label-field="city"
data='[{ "city": "Lisbon", "lon": -9.14, "lat": 38.72, "staff": 120 }]'></c2-map-layer>
<c2-map-layer type="lines" label="Routes" from-field="from" to-field="to"
data='[{ "from": "PRT", "to": [-74, 40.7] }]'></c2-map-layer>
</c2-map-chart>
On a map drawn from an SVG (projection="none"), the longitude and latitude fields are x and y in the SVG's own
coordinates.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
type | 'points' | 'lines' | points | What each row draws: a circle, or a line between two places. |
data | ChartRow[] | [] | The layer's rows, as an array or a JSON attribute. Compared by identity: replace the array to redraw. |
label | string | undefined | — | Legend and tooltip name of the layer. |
color | string | undefined | — | Explicit colour. Falls back to the layer's slot in the chart palette. |
lon-field | string | lon | Row field holding a point's longitude. |
lat-field | string | lat | Row field holding a point's latitude. |
region-field | string | — | Row field naming the region a point sits in, instead of a longitude and latitude. Read against the map's region-key. |
size-field | string | — | Row field encoded as the area of each point. Without it every point has the minimum size. |
size-label | string | — | Names the size measure in the tooltip. Defaults to the humanized size-field. |
label-field | string | — | Row field naming each point or line in the tooltip, and beside a point when labels is set. |
from-field | string | from | Row field holding where a line starts: a region key or a [lon, lat] pair. |
to-field | string | to | Row field holding where a line ends: a region key or a [lon, lat] pair. |
width-field | string | — | Row field encoded as the stroke width of each line. |
width-label | string | — | Names the width measure in the tooltip. Defaults to the humanized width-field. |
curve | 'geodesic' | 'arc' | 'straight' | geodesic | How a line travels: the shortest path over the globe, a gentle arc, or a straight segment on the drawn map. |
labels | boolean | false | Draws each point's label-field text beside it. |
hidden | boolean | false | Leaves the layer out of the map without removing the definition. |
c2-chart-legend
A legend linked to a chart by id. Place it anywhere in the document to control the legend's layout independently from the chart.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
for | string | — | Id of the chart this element presents. |
Slots
| Name | Description |
|---|---|
(default) | Replaces the generated legend. Use renderLegend or renderLegendItem for data-driven custom content. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
item | One interactive legend entry. |
marker | The colour swatch inside an entry. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-chart__legend--gap | pixel | 12px | Gap between legend entries. |
--c2-chart__legend--padding | padding | 0 | Padding around the legend. |
--c2-chart__legend--color | color | #71717a | Legend text colour. |
--c2-chart__legend--font-size | font-size | 12px | Legend font size. |
--c2-chart__legend__disabled--opacity | opacity | 0.38 | Opacity of a disabled entry. |
--c2-chart__legend-marker--size | pixel | 10px | Size of the colour swatch. |
--c2-chart__legend-marker--border-radius | border-radius | 999px | Radius of the colour swatch. |
c2-chart-tooltip
A tooltip linked to a chart by id. It can float beside the hovered point or render inline wherever it is placed in the document.
It is shown only while its chart has a hovered point, and says so through the custom state :state(open) rather
than by toggling hidden on itself: the host keeps exactly the attributes it was authored with, so a
server-rendered tooltip matches the hydrated one. An authored hidden still hides it.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
position | 'floating' | 'inline' | floating | Whether the tooltip follows the hovered point or occupies its authored HTML position. |
placement | 'top' | 'bottom' | 'start' | 'end' | top | Preferred side of the hovered point when position="floating". Flips at viewport edges. |
for | string | — | Id of the chart this element presents. |
Slots
| Name | Description |
|---|---|
(default) | Replaces the generated tooltip body. Use renderTooltip for data-driven custom content. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
bubble | The tooltip surface. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-chart__tooltip--background-color | color | #18181b | Tooltip background. |
--c2-chart__tooltip--color | color | #fafafa | Tooltip text colour. |
--c2-chart__tooltip--font-size | font-size | 12px | Tooltip font size. |
--c2-chart__tooltip--padding | padding | 8px 10px | Tooltip padding. |
--c2-chart__tooltip--border-radius | border-radius | 6px | Tooltip corner radius. |
--c2-chart__tooltip--box-shadow | box-shadow | 0 8px 24px rgba(24, 24, 27, 0.08) | Tooltip shadow. |
--c2-chart__tooltip--gap | pixel | 6px | Gap between tooltip rows. |
--c2-chart__legend-marker--size | pixel | 10px | Size of the colour swatch in a tooltip row. |
--c2-chart__legend-marker--border-radius | border-radius | 999px | Corner radius of a tooltip row's colour swatch. |