Imagine you have a lot of charts in your web project and all of them must follow a common design.

To acomplish that you can create your custom template and them apply it on the charts.

To create a custom template you need to:

  • Create a Class that inherit from FusionChartsTemplateBase.
  • Override it constructor to set the properties you want to be set.
  • Override a method called SetSeriesColors and use base.colors do create your List of colors.

See the code sample:

 

    

using Libero.FusionCharts.PropertySet;

namespace Libero.FusionCharts.Template
{ public class MyFancyTemplate : FusionChartsTemplateBase
    {
public MyFancyTemplate()
: base()         {
//Set here the PropertySets for this template. base.FontBasePropertySet = new FontBasePropertySet() { BaseFont = "Verdana"
            };
       
}
public override void SetSeriesColors()
{
//Set here the series colors for the template.     colors = new List<string>();
colors.Add("95B3D7");
colors.Add("D99795");
      colors.Add("C2D69A");
colors.Add("948B54");
colors.Add("B2A1C7");
colors.Add("93CDDD");
colors.Add("FAC090");
colors.Add("538ED5");
colors.Add("A5A5A5");
}
    }
}

Last edited Nov 25, 2010 at 6:21 PM by robertobarbedo, version 4

Comments

No comments yet.