for (int count=0;count<_dataSeries.size();count++)
{
XYDataSeries dataSeries = ((XYDataSeries)_dataSeries.elementAt(count));
XYDataPoint[] points = dataSeries.getDataSeries();
XYDataPoint previous = null;
if ( _visibleSeries.contains(dataSeries) )
{
if (dataSeries.getBeginAtOrigin())
{
previous = new XYDataPoint(_minX,_minY);
}
else
{
if (points.length!=0)
{
previous = points[0];
}
else
{
previous = new XYDataPoint(_minX, _minY);
}
}
g.setColor(dataSeries.getSeriesColour());
for (int pCount=0;pCount<points.length;pCount++)
{
int xPosition = (int)graphRect.getX() + (int)( ( points[pCount].getX() - _minX ) * scaleX );
int xPreviousPosition = (int)graphRect.getX() + (int)( ( previous.getX() - _minX ) * scaleX );
int yPosition = ( (int)graphRect.getY() + (int)graphRect.getHeight() ) - (int)( (points[pCount].getY() - _minY) * scaleY );
int yPreviousPosition = ( (int)graphRect.getY() + (int)graphRect.getHeight() ) - (int)( (previous.getY() - _minY) * scaleY );
g.drawLine( xPreviousPosition, yPreviousPosition, xPosition, yPosition );
previous = points[pCount];
}
}