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.
4949|Show Values in Slices |on/off |off |If enabled, show the category
5050values inside the pie slices.
5151
52+ |Labels font Size |Number |13 |Define the size of the font for internal and external labels on the pie.
53+
5254|Show categories next to Slices |on/off |off |If enabled, show the
5355category values next to the pie slices.
5456
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { ChartProps } from '../Chart';
77import { convertRecordObjectToString , recordToNative } from '../ChartUtils' ;
88import { themeNivo } from '../Utils' ;
99import { extensionEnabled } from '../../utils/ReportUtils' ;
10+ import { objMerge } from '../../utils/ObjectManipulation' ;
1011
1112/**
1213 * Embeds a PieChart (from Nivo) into NeoDash.
@@ -90,6 +91,8 @@ const NeoPieChart = (props: ChartProps) => {
9091 const cornerRadius = settings . cornerRadius ? settings . cornerRadius : 1 ;
9192 const arcLabelsSkipAngle = settings . arcLabelsSkipAngle ? settings . arcLabelsSkipAngle : 10 ;
9293
94+ const arcLabelsFontSize = settings . arcLabelsFontSize ? settings . arcLabelsFontSize : 13 ;
95+
9396 const legend = settings . legend ? settings . legend : false ;
9497 const colorScheme = settings . colors ? settings . colors : 'set2' ;
9598 const styleRules = useStyleRules (
@@ -131,9 +134,14 @@ const NeoPieChart = (props: ChartProps) => {
131134 return < NoDrawableDataErrorMessage /> ;
132135 }
133136
137+ const theme = objMerge ( themeNivo , {
138+ labels : {
139+ text : { fontSize : arcLabelsFontSize } ,
140+ } ,
141+ } ) ;
134142 return (
135143 < ResponsivePie
136- theme = { themeNivo }
144+ theme = { theme }
137145 data = { data }
138146 sortByValue = { sortByValue }
139147 enableArcLabels = { enableArcLabels }
Original file line number Diff line number Diff line change @@ -516,6 +516,11 @@ const _REPORT_TYPES = {
516516 type : SELECTION_TYPES . NUMBER ,
517517 default : 10 ,
518518 } ,
519+ arcLabelsFontSize : {
520+ label : 'Labels font Size' ,
521+ type : SELECTION_TYPES . NUMBER ,
522+ default : 13 ,
523+ } ,
519524 enableArcLinkLabels : {
520525 label : 'Show categories next to slices' ,
521526 type : SELECTION_TYPES . LIST ,
You can’t perform that action at this time.
0 commit comments