Sunburst Chart > Legend and Titles |
The legend displays entries for series with their names and predefined symbols. In Sunburst, you can access the legend using the Legend property of the FlexChartBase class and perform various customizations, as follows:
Header and Footer are descriptive texts at the top and bottom of the chart that provide information about the overall chart data. You can access Header and Footer of Sunburst chart by using the Header and the Footer property respectively, of the FlexChartBase class. Possible customizations with Header and Footer are as follows:
The following image displays Sunburst chart with the legend and titles set.
The following code snippet illustrates how to set respective properties for the legend and titles customization. This code uses the sample created in Quick Start.
' set the legend orientation Sunburst1.Legend.Orientation = C1.Chart.Orientation.Vertical ' set the legend position Sunburst1.Legend.Position = C1.Chart.Position.Auto ' set the legend stroke color Sunburst1.Legend.Style.StrokeColor = Color.DarkCyan ' Set the legend font Sunburst1.Legend.Style.Font = New Font("Arial", 9, FontStyle.Regular) ' set the legend title Sunburst1.Legend.Title = "Year" ' set the legend title stroke color Sunburst1.Legend.TitleStyle.StrokeColor = Color.Blue ' set the legend title font Sunburst1.Legend.TitleStyle.Font = New Font("Arial", 10, FontStyle.Bold) ' set the header Sunburst1.Header.Content = "Quarterly Sales" ' set the header font Sunburst1.Header.Style.Font = New Font("Arial", 11, FontStyle.Bold) ' set the header stroke Sunburst1.Header.Style.Stroke = Brushes.Brown ' set the footer Sunburst1.Footer.Content = "Company XYZ" ' set the footer font Sunburst1.Footer.Style.Font = New Font("Arial", 10, FontStyle.Bold) ' set the footer stroke Sunburst1.Footer.Style.Stroke = Brushes.Brown
// set the legend orientation sunburst1.Legend.Orientation = C1.Chart.Orientation.Vertical; // set the legend position sunburst1.Legend.Position = C1.Chart.Position.Auto; // set the legend stroke color sunburst1.Legend.Style.StrokeColor = Color.DarkCyan; // Set the legend font sunburst1.Legend.Style.Font = new Font("Arial", 9, FontStyle.Regular); // set the legend title sunburst1.Legend.Title = "Year"; // set the legend title stroke color sunburst1.Legend.TitleStyle.StrokeColor = Color.Blue; // set the legend title font sunburst1.Legend.TitleStyle.Font = new Font("Arial", 10, FontStyle.Bold); // set the header sunburst1.Header.Content = "Quarterly Sales"; // set the header font sunburst1.Header.Style.Font = new Font("Arial", 11, FontStyle.Bold); // set the header stroke sunburst1.Header.Style.Stroke = Brushes.Brown; // set the footer sunburst1.Footer.Content = "Company XYZ"; // set the footer font sunburst1.Footer.Style.Font = new Font("Arial", 10, FontStyle.Bold); // set the footer stroke sunburst1.Footer.Style.Stroke = Brushes.Brown;