From c156c0a38ffa9b674d9e023c8226982bdaaaea1d Mon Sep 17 00:00:00 2001 From: Nikita Kotlyarevskyy Date: Fri, 12 Jul 2024 14:00:15 +0200 Subject: [PATCH] adds the possibility to control the legend per subtype in the combo chart. If the legend is active in the combo chart, but the parameter showLegend is false in one of the subcharts, then the series objects of this subchart are excluded from the legend --- src/gen-charts.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gen-charts.ts b/src/gen-charts.ts index efe0c95e1..a5915b35d 100644 --- a/src/gen-charts.ts +++ b/src/gen-charts.ts @@ -725,6 +725,19 @@ export function makeXmlCharts (rel: ISlideRelChart): string { strXml += ' ' strXml += '' } + if (Array.isArray(rel.opts._type)) { + rel.opts._type.forEach(type => { + const showLegend = type.options.showLegend + if (!showLegend) { + type.data.forEach(obj => { + strXml += ' ' + strXml += ` ` + strXml += ' ' + strXml += ' ' + }) + } + }) + } strXml += '' } }