Closed canesen7 closed 10 months ago
You can set it like this:
series.dataItems[1].get("slice").set("fill", am5.color(0xff0000))
This will set the color of the second slice of the series.
Marty, hello again. I tried to
series.dataItems[1].get("slice").set("fill", am5.color(0xff0000))
But I push the column series to chart.series. So it is not "slice" but I don't know what it is. How can I find which parameter I must get for fill the column.
I solved my problem with
chart.series._values[1]._settings.fill = coloursList[0]
Thanks Marty...
Hi, I created a Pyramid Chart with React Class Based Component. When component mount, I can create chart without problem. When component did mount, I create chart and I push the series to the chart.
like this.
But when I change palette config, I need to only change the bar's fill color. So I set the chart to the state and when config change, I read this code
this.state.chart.series._values[0].set("fill", am5color("anycolor")
But this is not work. I think maybe state can't protect chart ref. So I set the chart this object like this.
this.chart = null
...plugin create functions
this.chart = chart
and when my config change triggers this:
this.chart.series._values[0].set("fill", am5color("anycolor")
and this is not work too. After that, I think maybe I need to set chart.serie to state or this object. When I set measure1 a state or this object this is not work too. Basically, how can I change the measure1 fill value with state or this object. I need this because I don't want to rerender all plugin processes when a basic state change.