This project is read-only.

Supose 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.    
            base.colors = new List<string>();
            base.colors.Add("95B3D7");
            base.colors.Add("D99795");
            base.colors.Add("C2D69A");
            base.colors.Add("948B54");
            base.colors.Add("B2A1C7");
            base.colors.Add("93CDDD");
            base.colors.Add("FAC090");
            base.colors.Add("538ED5");
            base.colors.Add("A5A5A5");
        }
    }
}

Last edited Nov 27, 2010 at 6:57 PM by robertobarbedo, version 4

Comments

No comments yet.