Change Fill Colors for StackingBar Chart Within PivotChart

Hello,
I am using a stacking bar chart within a pivot view tag and would like to know how to change the fill colors of the stacking bars?

this.chartSettings = {
      title: 'Stacking Bar Chart',
      chartSeries: { type: 'StackingBar' },
      primaryXAxis: {},
      primaryYAxis: {},
      tooltip: {
        template: '<span class="e-tooltip-wrap e-popup"><b>${rowHeaders}</b><br/><br/><b>${value}</b> ${columnHeaders}<br/> </span>',
      },

<ejs-pivotview
      #pivotview
      id="PivotView"
      [dataSourceSettings]="dataSourceSettings"
      [chartSettings]="chartSettings"
      [displayOption]="displayOption"
      tooltipTemplate="#Template"
      [toolbar]="toolbarOptions"
      allowDrillThrough="true"
      width="width"
      height="height"
    ></ejs-pivotview>



3 Replies 1 reply marked as answer

SN Sivamathi Natarajan Syncfusion Team October 12, 2020 12:18 PM UTC

 
Thanks for contacting Syncfusion support. 
 
Kindy customize the default color of pivot chart by providing a custom color palette of your choice by using the palettes property. Meanwhile, we have prepared a sample for your reference. 
 
 
Please let us know if you have concern. 
 
Regards, 
Sivamathi. 


Marked as answer

DM Dean M October 14, 2020 09:05 PM UTC

That worked. Thank you for your response. I was also able to get it work by creating this method:
 chartSeriesCreated(argsChartSeriesCreatedEventArgs) {
    args.series[0].fill = '#b4cb34';
    args.series[1].fill = '#77b8ae';
  }


SN Sivamathi Natarajan Syncfusion Team October 15, 2020 11:15 AM UTC

Hi Dean, 
 
Thanks for reply. 
 
Regards, 
Sivamathi. 


Loader.
Up arrow icon