Free Support Forum -

Bar Graph weirdness - what am I missing?

Using the following code I have created a single-cell bar graph (sort of a mutilation of the bar graph chart - for the record it's possible to do through the excel COM object).

int n = m_sheet.Charts.Add(ChartType.Bar, 0, 0, 1, 1);

Chart chart = m_sheet.ChartsNo [N];

chart.NSeries.Add(CellsHelper.CellIndexToName(1, 1), true);

chart.NSeries[0].Line.Color = Color.Black;

chart.NSeries[0].Area.ForegroundColor = Color.Black;

chart.IsLegendShown = false;

chart.IsDataTableShown = false;

chart.PlotArea.X = 0;

chart.PlotArea.Y = 0;

chart.ChartArea.Border.Weight = 0;

chart.CategoryAxis.IsVisible = false;

chart.ValueAxis.IsVisible = false;

chart.ChartArea.Border.IsVisible = false;

chart.GapWidth = 0;

chart.MajorGridLines.IsVisible = false;

The neighboring cell houses the value, which is a percentage. The graph seems to work fine within a certain range, but is completely off outside of that range (seems to work for 50-50% up to about 95%)

Any ideas?

I wasn't setting a min/max value. since the bar graph is on it's side, the ValueAxis was the min/max I needed to set (not the CategoryAxis).

I am not clear about your need.

Could you please post a file with your expected chart and a file created with Aspose.Cells? Then I can find the difference. Thank you.

Sorry; my second post was actually the solution to my problem (I wasn't setting the min/max values on the value axis).