Skip to content

Commit 1c244ac

Browse files
author
Robert Crocker
committed
Fixed the issue found in the pie chart legend.
1 parent e5157f8 commit 1c244ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function App() {
2626
<Container className="app">
2727
<GlobalStyle />
2828
<PieChart
29-
data={coffee_shop}
29+
data={coffee_shop.reverse()}
3030
label="product"
3131
value="sales"
3232
outerRadius={300}

src/charts/PieChart/PieChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default function PieChart({
127127

128128
const discreteColors = Math.min(keys.length, 9);
129129
const computedScheme = d3[`${colorScheme}`][discreteColors];
130-
const colorScale = d3.scaleOrdinal(computedScheme);
130+
const colorScale = d3.scaleOrdinal(Array.from(computedScheme).reverse());
131131
colorScale.domain(keys);
132132

133133
// ********************

0 commit comments

Comments
 (0)