Question

When doing a gradient fill on an area chart, the gradient ratios are used only between the min and max of the chart. The area below the min is then filled with the last color in the gradient.

To make sure that it was using the ratios only between the min and max I inserted a zero (0) into the chart and the gradient expanded to the full height. I also checked the gradient values by creating a with the gradient fill.

How do i get the ratios to be effective through the entire fill not just between the min and max?

Was it helpful?

Solution

The updateDisplayList method in mx.charts.renderers.AreaRenderer is the culprit here.

I believe you will need to create a custom itemRenderer for the area series based on AreaRenderer. From there I think you need to modify the fill method within updateDisplayList to pass the proper bounding region you want.

The fill portion (on/around line 167) would likely be as follows:

fill.begin(g, new Rectangle(0,0,unscaledWidth,unscaledHeight),null);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top