Category Axis problem



Please find the attachment.

On the CM Breakdown chart, there is a negative value for the total dollars for Variable Product Margin. The dollar value that corresponds to the bar is obscured by the label Variable Product Margin. Chart should be dynamic in response to the absolute value of the largest negative value plus the value of the largest positive value.

Is it possible to do this one.




Please try:

chart.ValueAxis.CrossAt = -50000;



My problem is negatvie values and labels are conflicting.I am unable to read value on x-axis.

I want to avoid that conflict.




To avoid the conflicts, you can change the crossat property:

Excel excel = new Excel();

int index = excel.Worksheets.Add(SheetType.Chart);

excel.Worksheets[index].Charts.Add(ChartType.Column, 0, 0, 0, 0);

Chart chart = excel.Worksheets[index].Charts[0];
chart.NSeries.Add("Summary!K2:K4", true);
chart.NSeries.CategoryData = "Summary!A2:A4";
chart.NSeries[0].DataLabels.IsValueShown = true;

chart.ValueAxis.CrossAt = -50000;
chart.ValueAxis.IsVisible = false;

Attachment is the output file. If it doesn't serve your need, please manually create a chart to show your need.