Ah!! Finally I uncovered the bug!
It’s a matter of values, that’s why you couldn’t find the problem…
Please try to generate stacked column charts with the code I previously sent you, passing the following data tables:
Test 1:
DataTable table = new DataTable();
DataColumn dc;
for (int i = 0; i < 13; i++)
{
dc = new DataColumn();
table.Columns.Add(dc);
}
table.Rows.Add(new object[] { “”, “Jan”, “Fev”, “Mar”, “Abr”, “Mai”, “Jun”, “Jul”, “Ago”, “Set”, “Out”, “Nov”, “Dez” });
table.Rows.Add(new object[] { “Cinema”, 0, 0, 8847, 214798, 81784, 0, 0, 0, 0, 0, 0, 0 });
This test works fine, the ToImage method returns a perfect bmp of the chart.
Now Test 2:
DataTable table = new DataTable();
DataColumn dc;
for (int i = 0; i < 13; i++)
{
dc = new DataColumn();
table.Columns.Add(dc);
}
table.Rows.Add(new object[] { “”, “Jan”, “Fev”, “Mar”, “Abr”, “Mai”, “Jun”, “Jul”, “Ago”, “Set”, “Out”, “Nov”, “Dez” });
table.Rows.Add(new object[] { “Cinema”, 0, 0, 8847, 214798.1, 81784, 0, 0, 0, 0, 0, 0, 0 });
Notice the values are exactly the same, except the one highlighted in bold. To this value I added 0.1. The ToImage method now returns a different image of the chart. Notice the scale on both images and you’ll see that the simple addition of 0.1 units to the maximum chart value altered the scale of the image. Different values of the decimal places in the maximum value will cause different results. I think that this only happens if the maximum value of the series has decimal places. If you remove them from the greater value but place them in any other value, the scale comes out right.
Can you check this bug and report back to me?
Thanks in advance,
Cruz