How to customized colors for chart bars + Legend based on database Color value i.e. dynamic chartType wise

Answered
Deepak Kumar asked on April 13, 2026

 Customized colors for chart bars  + Legend  based on database Color value i.e. dynamic chartType wise.
function ABCPivotUI(reportType, dataTable, PivotTableFields,chartType)
..

..

..

 var pivot = new Flexmonster({

     container: "#pivotcomponent",

     componentFolder: "https://cdn.flexmonster.com/",

     toolbar: true,

     beforetoolbarcreated: customizeFlexmonsterToolbar,
..
..

Attachments:
Screenshot_1.png

3 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster April 15, 2026

Hello,

Thank you for contacting us.

We recommend using the customizeChartElement() API call to change colors based on values from the data source. Please check the following example for reference: https://jsfiddle.net/flexmonster/9n3ksuyg/. Here you can find more information about chart customization: https://www.flexmonster.com/doc/customizing-pivot-charts/.

We hope that the information provided is helpful.

Kind regards,
Nadia

Public
Deepak Kumar April 20, 2026

Hi Team, 
As you suggested its working .but we facing another issue.

var sliceItem = {

    rows: row,

    columns: column,

    measures: vals 

 

}

 var pivot = new Flexmonster({

     container: "#pivotcomponent",

     componentFolder: "https://cdn.flexmonster.com/",

     toolbar: true,

     beforetoolbarcreated: customizeFlexmonsterToolbar,

     report: {

         "dataSource": {

             "dataSourceType": "json",

             "data": dataTable, 

              mapping: { 

                 Color: {

                     type: "property",

                      hierarchy: sliceItem.rows[0].uniqueName,

                 },

             },

         },
.....
.....

Currently i am able customize chart color based on row wise . suppose we have two column as show image how we differentiate partner & Project ,
Additionally
In Flexmonster, is it possible to include additional columns in a pivot report without applying any aggregation to those fields?


Public
Tetiana Lebiga Tetiana Lebiga Flexmonster May 12, 2026

Hello Deepak,

Thank you for reaching out.

Your license maintenance has expired and needs to be renewed to receive technical assistance from our team.

Our team has contacted you via email regarding renewal options. Meanwhile, you are welcome to explore the documentation, resolved tickets, and other resources available on our website.

Kind regards,
Tetiana

Please sign in or register to submit your answer