for column series how to get brush color dynamically based on it value set
any help on this current I want to change the brush color of the column chart based on it data let say I have 4 data
public data = [ { Franchise: "Marvel Universe All Films", TotalWorldBoxOfficeRevenue: 22.55, HighestGrossingMovieInSeries: 2.8 , ,"brush" :"gray" }, { Franchise: "Star Wars", TotalWorldBoxOfficeRevenue: 10.32, HighestGrossingMovieInSeries: 2.07 ,"brush" :"red" }, { Franchise: "Harry Potter", TotalWorldBoxOfficeRevenue: 9.19, HighestGrossingMovieInSeries: 1.34 ,"brush" :"red" }, { Franchise: "Avengers", TotalWorldBoxOfficeRevenue: 7.76, HighestGrossingMovieInSeries: 2.8 }, { Franchise: "Spider Man", TotalWorldBoxOfficeRevenue: 7.22, HighestGrossingMovieInSeries: 1.28 }, { Franchise: "James Bond", TotalWorldBoxOfficeRevenue: 7.12, HighestGrossingMovieInSeries: 1.11 ,"brush" :"green" } ];
Hello Muhammad,
In order to change the color of columns of the same column series, I would recommend utilizing the assigningCategoryStyle event of the series. This event’s arguments has information about the series and allows you to get the item that the series is drawing for. There is a fill property and stroke property that allows you to set the color for the series.
In order to use this event, you need to opt-in to it by setting the isCustomCategoryStyleAllowed property on the series to true.
I am attaching a sample project to demonstrate the usage of this event to dynamically color a column series.
Please let me know if you have any other questions or concerns on this matter.
1614.demo.zip