facebooktwittermenuarrow-up

GemBox Support Forum

Category Label in Combo Graph

Hi there,

A while ago you added the ability to have multilevel table categories, which I was doing in Column graphs. Now we need to do it in a combo graph.

var cx = excelChart as ColumnChart;
excelChart.SelectData(sheet.Cells.GetSubrange("E1:G" + (row - 1).ToString()), true);

cx.CategoryLabelsReference = "Sheet1!A2:D" + ((row - 1)).ToString();

cx.Axes.HorizontalCategory.MultiLevelLabels = true;

A combo chart does not seem to have the properties for when I cast to combo chart (causes errors)

cx.CategoryLabelsReference = "Sheet1!A2:D" + ((row - 1)).ToString();
cx.Axes.HorizontalCategory.MultiLevelLabels = true;

I want the output to look like the below. Is there any way to achieve this?

Thank you.
Nathan

Hi Nathan,

Try setting that property on the ColumnChart that is inside the ComboChart.

For example, like this:

ComboChart cx = ...
((ColumnChart)cx[0]).Axes.HorizontalCategory.MultiLevelLabels = true;

I hope this helps.

Regards,
Mario

Thank you! That worked perfectly!