Hi @Amjad_Sahi,
thanks for the response. Here is the link for the excel sheet:
Chart BoxWhisker.zip (10.7 KB)
Sample Code::
The below function is called for crearting box whisker in Excel.
private void CreateBoxChart(LayoutContainer chartInfo, BoxPlotChartData chartData,
ChartConfig chartConfig, Worksheet sheet, char columnName, int numOfCategory)
{
int index = sheet.Charts.Add(ChartType.BoxWhisker, ColumnHeadersRow, 3, ColumnHeadersRow + 20, 10);
var chart = sheet.Charts[index];
var chartArea = "B" + (ChartDataStartRow + 1 ) + ":" + columnName + numOfCategory;
var categoryData = "A" + (ChartDataStartRow + 1 ) + ":A" + numOfCategory;
chart.SetChartDataRange(chartArea, true);
chart.NSeries.CategoryData = categoryData;
int i = 0;
foreach (var series in chartData.Series)
{
chart.NSeries[i].Name = series.name;
chart.NSeries[i].LayoutProperties.ShowMeanLine = false;
chart.NSeries[i].Area.FillFormat.FillType = FillType.None;
chart.NSeries[i].Border.FormattingType = ChartLineFormattingType.Solid;
chart.NSeries[i].Border.Style = LineType.Solid;
i++;
}
chart.SeriesAxis.AxisBetweenCategories = false;
chart.SecondValueAxis.AxisBetweenCategories = false;
chart.CategoryAxis.AxisBetweenCategories = false;
if (chartConfig.XAxisConfigs != null)
{
chart.CategoryAxis.Title.Text = chartConfig.XAxisConfigs.Title ?? "";
}
chart.CategoryAxis.Title.RotationAngle = 0;
chart.CategoryAxis.AxisLine.IsVisible = false;
if (chartConfig.YAxisConfigs != null)
{
chart.ValueAxis.Title.Text = chartConfig.YAxisConfigs.Title ?? "";
}
chart.ValueAxis.Title.RotationAngle = 0;
chart.ValueAxis.AxisLine.IsVisible = false;
}
On hovering the chart, I am unable to set the series name through the code. But the same works if the chart is created on selecting the data from ms-excel. Please help me to set the series name as well.