Area chart has gaps in staircase mode (data specific).
Posted: Thu Jan 26, 2006 11:53 pm
Here is the code:
static void Main(string[] args)
{
ITChart pChart = new TChartClass();
//pChart.Aspect.View3D = false; //optional
pChart.SetTheme(EChartTheme.ctExcel, EColorPalette.cpExcel); // just to make chart nicer
int idx = pChart.AddSeries(ESeriesClass.scArea); // "area" and "horizontal area" have problem
ISeries pSeries = pChart.Series(idx);
pSeries.XValues.Order = EValueListOrder.loNone; // very important to preserve original data order
IAreaSeries pAreaSeries = pSeries.asArea;
pAreaSeries.Stairs = true; // stairs mode is important to see gaps, without it 2d is ok but 3d will miss one of side walls of the chart
pAreaSeries.AreaPen.Visible = false; // to see gaps better
pAreaSeries.LinePen.Color = 0xff; // to see gaps better
for (int i = 0; i < 7; i++)
//pSeries.AddXY(i, i, null, 0xffffff); // makes correct Area Chart
pSeries.AddXY(6 - i, 6 - i, null, 0xffffff); // makes incorrect Area Chart with gaps
// export graph to observe the problem
IBMPExport pBMP = pChart.Export.asBMP;
pBMP.Height = 250;
pBMP.Width = 600;
pBMP.SaveToFile("c:\\tee_testAreaStairsSortedDesc.bmp");
}
static void Main(string[] args)
{
ITChart pChart = new TChartClass();
//pChart.Aspect.View3D = false; //optional
pChart.SetTheme(EChartTheme.ctExcel, EColorPalette.cpExcel); // just to make chart nicer
int idx = pChart.AddSeries(ESeriesClass.scArea); // "area" and "horizontal area" have problem
ISeries pSeries = pChart.Series(idx);
pSeries.XValues.Order = EValueListOrder.loNone; // very important to preserve original data order
IAreaSeries pAreaSeries = pSeries.asArea;
pAreaSeries.Stairs = true; // stairs mode is important to see gaps, without it 2d is ok but 3d will miss one of side walls of the chart
pAreaSeries.AreaPen.Visible = false; // to see gaps better
pAreaSeries.LinePen.Color = 0xff; // to see gaps better
for (int i = 0; i < 7; i++)
//pSeries.AddXY(i, i, null, 0xffffff); // makes correct Area Chart
pSeries.AddXY(6 - i, 6 - i, null, 0xffffff); // makes incorrect Area Chart with gaps
// export graph to observe the problem
IBMPExport pBMP = pChart.Export.asBMP;
pBMP.Height = 250;
pBMP.Width = 600;
pBMP.SaveToFile("c:\\tee_testAreaStairsSortedDesc.bmp");
}