293 chartWidth = maxPointsPlotedInASeries * 10;
295 if (chartWidth > 1000)
298 chartHeight = chartWidth;
300 if (chartHeight > 500)
308 yRange = maxYValue - minYValue;
309 xRange = maxXValue - minXValue;
311 yScale = (double)chartHeight / yRange;
312 xScale = (double)chartWidth / xRange;
323 double sigTensPlace = floor (log10 (yRange));
325 sigTensPlace = pow (10.0, sigTensPlace);
327 yIncrement = floor (yRange / sigTensPlace) * sigTensPlace;
331 if (numOfYIncremets < 2)
333 yIncrement = yIncrement / 4.0;
335 else if (numOfYIncremets < 5)
337 yIncrement = yIncrement / 2.0;
339 else if (numOfYIncremets > 7)
341 yIncrement = yIncrement * 2.0;
343 else if (numOfYIncremets > 13)
345 yIncrement = yIncrement * 4.0;
348 yMin = floor (minYValue / yIncrement) * yIncrement;
349 yMax = ceil (maxYValue / yIncrement) * yIncrement;
351 yRange = yMax - yMin;
352 yScale = (double)chartHeight / yRange;
356 kkint32 height = chartHeight + 2 * yOffset;
357 kkint32 width = chartWidth + 2 * xOffset;
363 chart->
DrawLine (yOffset, xOffset, yOffset + chartHeight, xOffset, axisColor);
364 chart->
DrawLine (yOffset, xOffset, yOffset , xOffset + chartWidth, axisColor);
371 double y = yMin + yIncrement;
375 chart->
DrawLine (RasterCoordinates (PlotPoint (0.0, (
double)y)),
376 RasterCoordinates (PlotPoint (xMax, (
double)y)),
384 if ((yMin < 0.0) && (yMax > 0.0))
387 chart->
DrawLine (RasterCoordinates (PlotPoint (
double ((
kkint32)(xMin + 0.5)), 0.0)),
388 RasterCoordinates (PlotPoint (
double ((
kkint32)(xMax + 0.5)), 0.0)),
396 if ((xMin < 0.0) && (xMax > 0.0))
399 chart->
DrawLine (RasterCoordinates (PlotPoint (0.0,
double ((
kkint32)(yMin + 0.5)))),
400 RasterCoordinates (PlotPoint (0.0,
double ((
kkint32)(yMax + 0.5)))),
411 for (
kkuint32 seriesIDX = 0; seriesIDX < series.size (); seriesIDX++)
415 if (s->points.size () == 0)
418 PlotPoint lastPoint (s->points[0]);
420 chart->
DrawDot (RasterCoordinates (lastPoint), s->color, 3);
422 for (
kkuint32 plotIDX = 1; plotIDX < s->points.size (); plotIDX++)
424 PlotPoint point (s->points[plotIDX]);
426 chart->
DrawDot (RasterCoordinates (point), s->color, 3);
428 chart->
DrawLine (RasterCoordinates (lastPoint),
429 RasterCoordinates (point),
A class that is used by to represent a single image in memory.
unsigned __int32 kkuint32
void DrawDot(const Point &point, const PixelValue &color, kkint32 size)
void DrawLine(kkint32 bpRow, kkint32 bpCol, kkint32 epRow, kkint32 epCol)
Used by the Raster Class to represent the contents of one pixel.