for column series how to get brush color dynamically based on it value set
<igx-stacked-column-series [xAxis]="xAxis" [yAxis]="yAxis" [dataSource]="data" showDefaultTooltip="true" areaFillOpacity="1" [legend]="legend"> <igx-stacked-fragment-series valueMemberPath="USA" title="USA"></igx-stacked-fragment-series> <igx-stacked-fragment-series valueMemberPath="Europe" title="Europe"></igx-stacked-fragment-series> <igx-stacked-fragment-series valueMemberPath="China" title="China"></igx-stacked-fragment-series> </igx-stacked-column-series>can color of a single fragment can be changed ?
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
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" } ];