You are viewing documentation for an older version. For current documentation - click here.

FusionCharts ASP Class API lets you configure attributes of various chart elements like dataset, dataplot, categories etc. In this section we will see sample usage of those functions of FusionCharts ASP Class which help in achieving this. Topics include:

Provide categories attributes

Attributes which are specific to <categories> element can be set using setCategoriesParams function. We will pass a delimiter (default is ";") separated list of attributes to the function.

Example:

Call FC.setCategoriesParams("font=Arial;fontSize=13;fontColor=ff0000")
Provide attribute for each category

We can configure each category while adding a category using addCategory function. This is done by passing category attributes as a list of delimiter separated attributes as the second parameter to the addCategory function.

Example:

Call FC.addCategory("Week 1","toolText=Sales for week 1")
Call FC.addCategory("Week 2 ","toolText=Sales for second week;showlabel=1")
Call FC.addCategory("Week 3 ","showlabel=0")
Provide dataset attributes

To provide dataset attributes we need to use the function - addDataset. It accepts the seriesName attribute of the dataset as its first parameter. The other parameter accepts a delimiter (default is ;) separated list of dataset attributes.

The example below will add 3 datasets for a combination chart. The first two datasets with 'This Month' and 'Previous Month' as seriesName (respectively) , will be set to Primary Y-Axis and would not show data values. The third dataset with 'Total Quantity' as seriesName, will be set to Secondary Y-Axis, 5 sided anchors and various other anchor settings.

Call FC.addDataset("This Month","showValues=0;parentYAxis=P")
      ...     
Call FC.addDataset("Previous Month","showValues=0;parentYAxis=P") 
      ...        
Call FC.addDataset("Total Quantity","parentYaxis=S;anchorSides=5;anchorradius=6;color=880000;anchorBgcolor=EE0000")

The chart that follows is as shown below:

Provide attribute to each dataplot

setChartParams() function sets chart parameters globally. However, we may need to set specific properties to particular dataplot. To do so, we need to send the parameters through addChartData() function while feeding data. Consider the code below:

# Create a line chart object 
    FC = new FusionCharts("Column3D","300","250")  
        ...
# add chart values and category names
    Call FC.addChartData("48200", "label=Week 1;alpha=40;showlabel=0;showValue=0")
    Call FC.addChartData("32100", "label=Week 2;alpha=40;showlabel=0;showValue=0")
    Call FC.addChartData("21400", "label=Week 3;tooltext=Lowest;link=tooLow.asp")
    Call FC.addChartData("54400", "label=Week 4;showlabel=0;showValue=0;alpha=40;tooltext=Highest")
        ...