* @param axisChart
* @param iStockChartDataSet
*********************************************************************************************/
static final void render( AxisChart axisChart, IStockChartDataSet iStockChartDataSet )
{
StockChartProperties stockChartProperties=(StockChartProperties) iStockChartDataSet.getChartTypeProperties();
Graphics2D g2d=axisChart.getGraphics2D();
DataAxisProperties dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties();
IDataSeries iDataSeries= (IDataSeries) axisChart.getIAxisDataSeries();
//---cache the computed values
//float[][] yAxisCoordinates=new float[ iStockChartDataSet.getNumberOfDataSets() ][ iStockChartDataSet.getNumberOfDataItems() ];
//---init for first segment
Line2D.Float line=new Line2D.Float( axisChart.getXAxis().getTickStart(),
0,
axisChart.getXAxis().getTickStart(),
0 );
Line2D.Float openLine=null;
if( iStockChartDataSet.hasOpenValues() )
{
openLine=new Line2D.Float( axisChart.getXAxis().getTickStart() - stockChartProperties.getOpenPixelLength() - 1,
0,
axisChart.getXAxis().getTickStart() - 1,
0 );
}
Line2D.Float closeLine=null;
if( iStockChartDataSet.hasCloseValues() )
{
closeLine=new Line2D.Float( axisChart.getXAxis().getTickStart() + 1,
0,
axisChart.getXAxis().getTickStart() + stockChartProperties.getClosePixelLength() + 1,
0 );
}
//LOOP
//---draw each line to the image
for( int i=0; i < iStockChartDataSet.getNumberOfDataItems(); i++ )
{
line.y1= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(),
iStockChartDataSet.getLowValue( i ),
axisChart.getYAxis().getScaleCalculator().getMinValue() );
line.y2= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(),
iStockChartDataSet.getHighValue( i ),
axisChart.getYAxis().getScaleCalculator().getMinValue() );
String label;
if( axisChart.getXAxis().getAxisLabelsGroup() != null )
{
label = axisChart.getXAxis().getAxisLabelsGroup().getTextTag( i ).getText();
}
else
{
label = null;
}
//---if we are generating an ImageMap, store the image coordinates
if( axisChart.getGenerateImageMapFlag() )
{
axisChart.getImageMap().addImageMapArea( new CircleMapArea( line.x1,
line.y1,
iStockChartDataSet.getLowValue( i ),
label,
iStockChartDataSet.getLegendLabel( StockChartDataType.LOW.getInt() ) ) );
axisChart.getImageMap().addImageMapArea( new CircleMapArea( line.x2,
line.y2,
iStockChartDataSet.getHighValue( i ),
label,
iStockChartDataSet.getLegendLabel( StockChartDataType.HIGH.getInt() ) ) );
}
g2d.setPaint( iStockChartDataSet.getPaint( StockChartDataType.HIGH.getInt() ) );
g2d.setStroke( stockChartProperties.getHiLowStroke() );
g2d.draw( line );
line.x1+=axisChart.getXAxis().getScalePixelWidth();
line.x2=line.x1;
if( openLine != null )
{
if( iStockChartDataSet.getOpenValue( i ) != Double.NaN )
{
openLine.y1= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(),
iStockChartDataSet.getOpenValue( i ),
axisChart.getYAxis().getScaleCalculator().getMinValue() );
openLine.y2=openLine.y1;
g2d.setPaint( iStockChartDataSet.getPaint( StockChartDataType.OPEN.getInt() ) );
g2d.setStroke( stockChartProperties.getOpenStroke() );
g2d.draw( openLine );
//---if we are generating an ImageMap, store the image coordinates
if( axisChart.getGenerateImageMapFlag() )
{
axisChart.getImageMap().addImageMapArea( new CircleMapArea( openLine.x1,
openLine.y1,
iStockChartDataSet.getOpenValue( i ),
label,
iStockChartDataSet.getLegendLabel( StockChartDataType.OPEN.getInt() ) ) );
}
openLine.x1+=axisChart.getXAxis().getScalePixelWidth();
openLine.x2+=axisChart.getXAxis().getScalePixelWidth();
}
}
if( closeLine != null )
{
if( iStockChartDataSet.getOpenValue( i ) != Double.NaN )
{
closeLine.y1= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(),
iStockChartDataSet.getCloseValue( i ),
axisChart.getYAxis().getScaleCalculator().getMinValue() );
closeLine.y2=closeLine.y1;
g2d.setPaint( iStockChartDataSet.getPaint( StockChartDataType.CLOSE.getInt() ) );
g2d.setStroke( stockChartProperties.getCloseStroke() );
g2d.draw( closeLine );
//---if we are generating an ImageMap, store the image coordinates
if( axisChart.getGenerateImageMapFlag() )
{