Skip to content

Commit

Permalink
Fix logic for dataLabelFormat code in Pie and Donut charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Cronin committed Jul 22, 2020
1 parent ba2c5f9 commit e3348fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gen-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ export function addChartDefinition(target: ISlideLib, type: CHART_NAME | IChartM
options.dataBorder.color = 'F9F9F9'
//
if (!options.dataLabelFormatCode && options._type === CHART_TYPE.SCATTER) options.dataLabelFormatCode = 'General'
if (!options.dataLabelFormatCode && (options._type === CHART_TYPE.PIE || options._type === CHART_TYPE.DOUGHNUT)) options.dataLabelFormatCode = options.showPercent ? '0%' : 'General'
options.dataLabelFormatCode = options.dataLabelFormatCode && typeof options.dataLabelFormatCode === 'string' ? options.dataLabelFormatCode : '#,##0'
if (options._type === CHART_TYPE.PIE || options._type === CHART_TYPE.DOUGHNUT) options.dataLabelFormatCode = options.showPercent ? '0%' : 'General'
//
// Set default format for Scatter chart labels to custom string if not defined
if (!options.dataLabelFormatScatter && options._type === CHART_TYPE.SCATTER) options.dataLabelFormatScatter = 'custom'
Expand Down

0 comments on commit e3348fc

Please # to comment.