File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
docs/modules/ROOT/pages/user-guide/reports Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ the pie slices in order of size.
49
49
|Show Values in Slices |on/off |off |If enabled, show the category
50
50
values inside the pie slices.
51
51
52
+ |Labels font Size |Number |13 |Define the size of the font for internal and external labels on the pie.
53
+
52
54
|Show categories next to Slices |on/off |off |If enabled, show the
53
55
category values next to the pie slices.
54
56
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { ChartProps } from '../Chart';
7
7
import { convertRecordObjectToString , recordToNative } from '../ChartUtils' ;
8
8
import { themeNivo } from '../Utils' ;
9
9
import { extensionEnabled } from '../../utils/ReportUtils' ;
10
+ import { objMerge } from '../../utils/ObjectManipulation' ;
10
11
11
12
/**
12
13
* Embeds a PieChart (from Nivo) into NeoDash.
@@ -90,6 +91,8 @@ const NeoPieChart = (props: ChartProps) => {
90
91
const cornerRadius = settings . cornerRadius ? settings . cornerRadius : 1 ;
91
92
const arcLabelsSkipAngle = settings . arcLabelsSkipAngle ? settings . arcLabelsSkipAngle : 10 ;
92
93
94
+ const arcLabelsFontSize = settings . arcLabelsFontSize ? settings . arcLabelsFontSize : 13 ;
95
+
93
96
const legend = settings . legend ? settings . legend : false ;
94
97
const colorScheme = settings . colors ? settings . colors : 'set2' ;
95
98
const styleRules = useStyleRules (
@@ -131,9 +134,14 @@ const NeoPieChart = (props: ChartProps) => {
131
134
return < NoDrawableDataErrorMessage /> ;
132
135
}
133
136
137
+ const theme = objMerge ( themeNivo , {
138
+ labels : {
139
+ text : { fontSize : arcLabelsFontSize } ,
140
+ } ,
141
+ } ) ;
134
142
return (
135
143
< ResponsivePie
136
- theme = { themeNivo }
144
+ theme = { theme }
137
145
data = { data }
138
146
sortByValue = { sortByValue }
139
147
enableArcLabels = { enableArcLabels }
Original file line number Diff line number Diff line change @@ -516,6 +516,11 @@ const _REPORT_TYPES = {
516
516
type : SELECTION_TYPES . NUMBER ,
517
517
default : 10 ,
518
518
} ,
519
+ arcLabelsFontSize : {
520
+ label : 'Labels font Size' ,
521
+ type : SELECTION_TYPES . NUMBER ,
522
+ default : 13 ,
523
+ } ,
519
524
enableArcLinkLabels : {
520
525
label : 'Show categories next to slices' ,
521
526
type : SELECTION_TYPES . LIST ,
You can’t perform that action at this time.
0 commit comments