Skip navigation
Currently Being Moderated

Keep color index in piechart

May 16, 2012 7:15 AM

Tags: #actionscript #colors #checkbox #piechart

Hi,

 

I have a Piechart working with an ArrayCollection, and i control the showing slices of the PieChart with its respective Checkbox.

 

I can set my custom colors for each slice and they show correcly. But when i erase a slice from the chart with the checkbox (erasing the respective data from the ArrayCollection), the index color of the slices regroup, and what was a blue slice now its another color.

 

Example:

 

Lets say that the data of the pie chart its:

[one],[two],[three],[four],[five],[six]

 

the colors for each data is:

[green],[yellow],[blue],[red],[white],[black]

 

And if i delete the element [two] wich color its [yellow], the colors now change to:

[green],[yellow],[blue],[red],[white].

 

Is there a way to hardcode the color of each slice so that they dont fix when a data its erased? i create this piechart via ActionScript:

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points