stackedbarrenderer and lineshape reneder on the XYStyle

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
muruvetri
Posts: 2
Joined: Fri Feb 08, 2008 5:29 pm

stackedbarrenderer and lineshape reneder on the XYStyle

Post by muruvetri » Sun Feb 17, 2008 9:01 am

I am using stackedbarrenderer and lineshapre reneder
I am running into two problems
1- how do I create gaps between bars?
2- How do I move dateAxis to middle the lineshapereneder doesn't recongonize the dateaxis moved to middle hence plotting the point orginally where the axis was though?


Here is the code
XYPlot plot = new XYPlot();
JFreeChart chart = new JFreeChart(plot);
chart.setBorderVisible(false);


DateAxis dateAxis = new DateAxis();
dateAxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
plot.setDomainAxis(dateAxis);

plot.setRangeAxis(new NumberAxis());



//Create Dummy data

TimeTableXYDataset data = new TimeTableXYDataset();
data.add(new Day(1, 1, 2008), 50, "Y");
data.add(new Day(2, 1, 2008), 45, "Y");
data.add(new Day(3, 1, 2008), 12, "Y");
data.add(new Day(4, 1, 2008), -12.0, "Y");

// final TimeSeries series2 = new TimeSeries("Series 2", Day.class);
data.add(new Day(1, 1, 2008), 8.0, "X");
data.add(new Day(2, 1, 2008), 16.0, "X");
data.add(new Day(3, 1, 2008), 21.0, "X");
data.add(new Day(4, 1, 2008), -5.0, "X");
plot.setDataset(dataset);
plot.setRenderer(new StackedXYBarRenderer());

plot.setDataset(1, data);
plot.setRenderer(1, new XYLineAndShapeRenderer());
plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

Locked