This repository was archived by the owner on Jun 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed
src/components/DonutChart Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
66and adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
77
8- <!-- ## Unreleased -->
8+ ## Unreleased
9+
10+ ### Changed
11+
12+ - Added padding between slices in ` <DonutChart /> ` to improve visibility of small values.
913
1014## [ 16.15.2] - 2025-05-02
1115
Original file line number Diff line number Diff line change @@ -166,7 +166,8 @@ export function Chart({
166166
167167 const createPie = pie < DataPoint > ( )
168168 . value ( ( { value} ) => value ! )
169- . sort ( null ) ;
169+ . sort ( null )
170+ . padAngle ( 0.05 ) ;
170171 const pieChartData = createPie ( points ) ;
171172 const isEveryValueZero = points . every ( ( { value} ) => value === 0 ) ;
172173 const emptyState = pieChartData . length === 0 || isEveryValueZero ;
Original file line number Diff line number Diff line change 1+ import type { Story } from '@storybook/react' ;
2+
3+ import { META } from './meta' ;
4+
5+ import type { DonutChartProps } from '../DonutChart' ;
6+
7+ import { DEFAULT_PROPS , Template } from './data' ;
8+
9+ export default {
10+ ...META ,
11+ title : 'polaris-viz/Chromatic/Charts/DonutChart' ,
12+ parameters : {
13+ ...META . parameters ,
14+ chromatic : { disableSnapshot : false } ,
15+ } ,
16+ } ;
17+
18+ export const TinySlices : Story < DonutChartProps > = Template . bind ( { } ) ;
19+
20+ TinySlices . args = {
21+ ...DEFAULT_PROPS ,
22+ data : [
23+ {
24+ name : 'Shopify Payments' ,
25+ data : [ { key : 'april - march' , value : 5000000 } ] ,
26+ } ,
27+ {
28+ name : 'Paypal' ,
29+ data : [ { key : 'april - march' , value : 250 } ] ,
30+ } ,
31+ {
32+ name : 'Other' ,
33+ data : [ { key : 'april - march' , value : 1000000 } ] ,
34+ } ,
35+ {
36+ name : 'Amazon Pay' ,
37+ data : [ { key : 'april - march' , value : 400 } ] ,
38+ } ,
39+ ] ,
40+ } ;
You can’t perform that action at this time.
0 commit comments