Fläche hervorheben
Beim Überfahren der Legende wird eine Fläche hervorgehoben.
Diagramm ohne Website-Rahmen öffnen ↗
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "area",
toolbar: {
show: false
}
},
series: [
{
name: "North",
data: [38, 36, 36, 38, 37, 40, 39, 41, 39, 42, 42, 40, 42, 42, 43, 45, 48, 49, 48, 50, 49, 51, 52, 54]
},
{
name: "South",
data: [43, 43, 45, 42, 42, 45, 45, 43, 44, 42, 44, 44, 44, 47, 49, 51, 53, 54, 54, 53, 52, 55, 54, 55]
},
{
name: "East",
data: [42, 45, 45, 43, 46, 47, 45, 46, 46, 48, 50, 51, 51, 54, 54, 52, 50, 48, 49, 46, 45, 44, 46, 49]
}
],
legend: {
onItemHover: {
highlightDataSeries: true
}
},
fill: {
opacity: 0.25
},
stroke: {
width: 2
},
title: {
text: "Energy use by grid zone"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "area",
toolbar: {
show: false
}
},
series: [
{
name: "North",
data: [38, 36, 36, 38, 37, 40, 39, 41, 39, 42, 42, 40, 42, 42, 43, 45, 48, 49, 48, 50, 49, 51, 52, 54]
},
{
name: "South",
data: [43, 43, 45, 42, 42, 45, 45, 43, 44, 42, 44, 44, 44, 47, 49, 51, 53, 54, 54, 53, 52, 55, 54, 55]
},
{
name: "East",
data: [42, 45, 45, 43, 46, 47, 45, 46, 46, 48, 50, 51, 51, 54, 54, 52, 50, 48, 49, 46, 45, 44, 46, 49]
}
],
legend: {
onItemHover: {
highlightDataSeries: true
}
},
fill: {
opacity: 0.25
},
stroke: {
width: 2
},
title: {
text: "Energy use by grid zone"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Warten auf das Diagramm.
Open Data & agent view to read this chart through chart.describe().
Aus der laufenden Bibliothek über das optionale agent/describe -Modul gelesen. Text, Tabelle und JSON zeigen denselben Zustand. Ausschließlich Demonstrationsdaten.
$ wcc chart export highlight-filter-area-highlight.json --out highlight-filter-area-highlight.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Speichern Sie zuerst eine JSON-Spezifikation und prüfen Sie vor dem Rendern die geladene Runtime und die unterstützten Module. Befehlsreferenz
Loading /gallery/highlight-filter/area-highlight/index.md …