| Example |
| Here is a simple Stock Chart. Notice that when declaring the data set, I use the StockChartDataSet Object which implements the IStockChartDataSet interface. |
|
String[] xAxisLabels= { "June 2", "June 3", "June 4", "June 5", "June 6", "June 7", "June 8" }; String xAxisTitle= "Days"; String yAxisTitle= "$$$"; String title= "Id Software"; DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title ); StockChartDataSet stockChartDataSet; double[] highs= {...}; double[] lows= {...}; double[] opens= {...}; double[] closes= {...}; StockChartProperties stockChartProperties= new StockChartProperties(); stockChartDataSet= new StockChartDataSet( highs, "High", lows, "Low", Color.black, stockChartProperties ); stockChartDataSet.setOpenValues( opens, "Open", Color.red ); stockChartDataSet.setCloseValues( closes, "Close", Color.green ); dataSeries.addIAxisPlotDataSet( stockChartDataSet ); ChartProperties chartProperties= new ChartProperties(); AxisProperties axisProperties= new AxisProperties(); LegendProperties legendProperties= new LegendProperties(); AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, AxisCharts.width, AxisCharts.height ); super.exportImage( axisChart, "basicChart" ); |
|
| Strokes |
|
The StockChartProperties Object contains methods for specifying the Stroke
interface used for the Hi/Low, Open, and Close, lines.
|
|
stockChartProperties.setHiLowStroke( new BasicStroke( 3.0f ) ); stockChartProperties.setCloseStroke( new BasicStroke( 2.5f ) ); |
|
| Open/Close Line Lengths |
|
The StockChartProperties Object contains methods for specifying the pixel length of the Open and Close lines.
|
|
stockChartProperties.setOpenPixelLength( 10 ); stockChartProperties.setClosePixelLength( 20 ); |
|
|