Review ratings
Star pictograms per rating, one star = 10 reviews.
Open the chart without page chrome ↗
const options = {
chart: {
height: 400,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "unit",
toolbar: {
show: false
}
},
series: [480, 310, 120, 60, 40],
labels: ["5 ★", "4 ★", "3 ★", "2 ★", "1 ★"],
colors: ["#16a34a", "#65a30d", "#d97706", "#ea580c", "#dc2626"],
plotOptions: {
unit: {
layout: "columns",
shape: "pictogram",
pictogram: {
mark: "star"
},
unitValue: 10,
clusterLabels: {
show: true,
position: "bottom"
}
}
},
title: {
text: "1 010 product reviews (1 star = 10)"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
WestCoastCharts.use(types)
const options = {
chart: {
height: 400,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "unit",
toolbar: {
show: false
}
},
series: [480, 310, 120, 60, 40],
labels: ["5 ★", "4 ★", "3 ★", "2 ★", "1 ★"],
colors: ["#16a34a", "#65a30d", "#d97706", "#ea580c", "#dc2626"],
plotOptions: {
unit: {
layout: "columns",
shape: "pictogram",
pictogram: {
mark: "star"
},
unitValue: 10,
clusterLabels: {
show: true,
position: "bottom"
}
}
},
title: {
text: "1 010 product reviews (1 star = 10)"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export unit-review-ratings.json --out unit-review-ratings.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/unit/review-ratings/index.md …