priceVolumeChart problem
Posted: Tue Oct 24, 2006 9:52 am
Hi guys,
I have a dataset which contains the price data for two stocks over a period of time. When plotting the dataset, both line graphs are of the same color.
Is it possible to alter the colors of the lines without having to specify two different datasets - similar to a highLowChart?
I have a dataset which contains the price data for two stocks over a period of time. When plotting the dataset, both line graphs are of the same color.
Code: Select all
JFreeChart chart = ChartFactory.createTimeSeriesChart(title, "", "", priceDataset, true, true, false);
chart.setBackgroundPaint(new Color(255, 255, 240));
XYPlot plot = chart.getXYPlot();
NumberAxis rangeAxis1 = (NumberAxis) plot.getRangeAxis();
rangeAxis1.setLowerMargin(0.5);
rangeAxis1.setUpperMargin(0.4);
DecimalFormat format = new DecimalFormat("0");
rangeAxis1.setNumberFormatOverride(format);
XYItemRenderer renderer1 = plot.getRenderer();
renderer1.setPaint(new Color(0, 102, 221));