PptxGenJS icon indicating copy to clipboard operation
PptxGenJS copied to clipboard

allows each subchart in the combo chart to react to the parameter showLegend

Open kotlyarevskyy opened this issue 7 months ago • 0 comments

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

This is very practical if both subcharts have the same data array, which means that the same series items appear twice in the legend

const comboOptions = {

        /** orientation/ grouping*/
        barDir: chartOrientation,
        barGrouping: barGrouping,

        /** legend */
        showLegend: true,  // LEGEND IS ACTIVE
        legendPos: 'b'
      }

const comboCharts = [
        {
          type: this.pptx.ChartType.line,
          data: data,
          options: {
            showLegend: true // SERIES LABELS FROM THE LINE ARE GOING TO BE DISPLAYED
          }
        },
        {
          type: this.pptx.ChartType.area,
          data: data,
          options: {
            showLegend: false // SERIES LABELS FROM THE AREA ARE HIDDEN
          }
        }
      ]

kotlyarevskyy avatar Jul 16 '24 08:07 kotlyarevskyy