Change the color of the trendline value in FusionCharts v3 for Flash

It seems like FusionCharts does not support changing the color of a trendline via the TRENDVALUES style application.  The color always seems to default to the color of the trendline.

The fix to this issue involves modifying the source of the XYPlotChart.as file (you’ll need the source for fusioncharts to be able to do this).

Search the file for the following line (it should be line 1789):

trendFontObj.color = this.trendLines [i].color;

Right afer this line, paste the following code:

if ( this.styleM.getTextStyle (this.objects.TRENDVALUES).color != undefined ) 
{ 
    trendFontObj.color = this.styleM.getTextStyle (this.objects.TRENDVALUES).color; 
}

There may be a more “elegant” way of doing this, but the code above will enable you to change the color of trend value lines by using styles in fusioncharts.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.