Check out 3 new chart types in FusionCharts 3.15

Introducing 3 new chart types - Sankey, Chord & Sunburst

Check Them Out

Legend

The legend is a chart element that you can use to display the name and color of a data series. It also allows you to interact with different data series when your chart data has more than one data series. This helps you relate a data plot to its series name using its color.

In the image given below, you can see the legend in a chart labeled:

Legend

Customize a Legend#

You can customize a legend by assigning custom values to different properties of the Legend object in an object:

Show/Hide Legend#

To hide the legend, set the value of the Show properties to false. Refer to the code given below:

visualizationObj.Legend.Show = false;
Were you able to implement this?

Set Legend Title#

Set the title of the legend as string using the Text properties. Refer to the code given below:

visualizationObj.Legend.Caption = "column chart Legend section";
Were you able to implement this?

Set Legend Position#

Set the position of the legend as BOTTOM or RIGHT using the Position properties. Refer to the code given below:

visualizationObj.Legend.Position = LegendObject.LegendPosition.Bottom;|
Were you able to implement this?

Customize Font Properties#

Customize the font properties of the legend title using the following:

  • Set the font size as an integer using the FontSize properties.
  • Set the font type as string using the FontName properties.
  • Set the font color as hex code using the FontColor properties.
  • Display the title as bold by setting the Bold properties to true.

Refer to the code given below:

visualizationObj.Legend.FontSize = 16;
visualizationObj.Legend.FontName = "Arial";
visualizationObj.Legend.FontColor = "#000000";
visualizationObj.Legend.Bold = true;
Were you able to implement this?

The detailed chart with all the above customizations is shown below:

Revenues (In USD)$0$5K$10K$15K$20K$25K$30KQuarterQ1Q2Q3Q4Comparison of Quarterly RevenueComparsionPrevious YearCurrent Year
Jump to