Skip to content

Commit 7519afe

Browse files
chore(docs): Custom color example should use fewer sections (#12559)
Two blue sections were being used. This caused a problem in high contrast mode since the sections are highlighted. This commit should adjust us down to one section, but allow us to keep the cute pyramid-in-sky effect. Fixes #12423 Assisted-by: Cursor
1 parent 8c89c01 commit 7519afe

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/react-charts/src/victory/components/ChartPie/examples/ChartPieCustomColorScale.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ interface Data {
1111

1212
export const ChartPieCustomColorScale: React.FunctionComponent = () => {
1313
const data: Data[] = [
14-
{ x: 'Sky', y: 38 },
1514
{ x: 'Shady side of pyramid', y: 7 },
1615
{ x: 'Sunny side of pyramid', y: 17 },
17-
{ x: 'Sky', y: 38 }
16+
{ x: 'Sky', y: 76 }
1817
];
1918
const legendData: Data[] = [{ name: 'Sky' }, { name: 'Shady side of pyramid' }, { name: 'Sunny side of pyramid' }];
19+
const pyramidStartAngle = 0.38 * 360;
2020

2121
return (
2222
<div style={{ height: '230px', width: '450px' }}>
2323
<ChartPie
2424
ariaDesc="Average number of pets"
2525
ariaTitle="Pie chart example"
2626
colorScale={[
27-
chart_theme_blue_ColorScale_100.var,
2827
chart_theme_orange_ColorScale_300.var,
2928
chart_theme_yellow_ColorScale_100.var,
3029
chart_theme_blue_ColorScale_100.var
@@ -37,6 +36,8 @@ export const ChartPieCustomColorScale: React.FunctionComponent = () => {
3736
legendOrientation="vertical"
3837
legendPosition="right"
3938
name="chart2"
39+
endAngle={pyramidStartAngle + 360}
40+
startAngle={pyramidStartAngle}
4041
padding={{
4142
bottom: 20,
4243
left: 20,

0 commit comments

Comments
 (0)