Hi, there~
I wonder about a difference between StackedXYAreaRenderer and StackedXYAreaRenderer2 .
please, notice to me..
Diff. StackedXYAreaRenderer and StackedXYAreaRenderer2 ??
Diff. StackedXYAreaRenderer and StackedXYAreaRenderer2 ??
Tokdo belongs to Korea.
Not a 'sea of japan', But a 'East Sea(Dong hae)'
Not a 'sea of japan', But a 'East Sea(Dong hae)'
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
StackedXYAreaRenderer was contributed by another developer who based it on the StandardXYItemRenderer class. It carries over a few things that it probably shouldn't (like the shapes), and sometime I'll try to clean it up.
StackedXYAreaRenderer2 uses a different drawing approach, calculating a polygon for each data point and filling that. As a result, it has more intuitive "hotspots" for tooltips (and URLs when used in an HTML image map), but sometimes it does show some drawing artefacts.
Try them both out and tell me which works better. It would make sense to try to combine the best of each into a single class.
StackedXYAreaRenderer2 uses a different drawing approach, calculating a polygon for each data point and filling that. As a result, it has more intuitive "hotspots" for tooltips (and URLs when used in an HTML image map), but sometimes it does show some drawing artefacts.
Try them both out and tell me which works better. It would make sense to try to combine the best of each into a single class.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


First of all, thanks for your answer.
but, I don't understand StackedXYAreaRenderer is based on the StandardXYItemRenderer.
AbstractRender
....|
....+- AbstractXYItemRenderer
..........|
..........+- XYAreaRenderer
..........|..........|
..........|..........+- StackedXYAreaRenderer
..........|
..........+- XYAreaRenderer2
....................|
....................+- StackedXYAreanRenderer2
I found a hierarchy like above.
and StandardXYItemRenderer is super for CyclicXYItemRenderer.
anyway, I try them for my program.
but, I don't understand StackedXYAreaRenderer is based on the StandardXYItemRenderer.
AbstractRender
....|
....+- AbstractXYItemRenderer
..........|
..........+- XYAreaRenderer
..........|..........|
..........|..........+- StackedXYAreaRenderer
..........|
..........+- XYAreaRenderer2
....................|
....................+- StackedXYAreanRenderer2
I found a hierarchy like above.
and StandardXYItemRenderer is super for CyclicXYItemRenderer.
anyway, I try them for my program.
Tokdo belongs to Korea.
Not a 'sea of japan', But a 'East Sea(Dong hae)'
Not a 'sea of japan', But a 'East Sea(Dong hae)'
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It's based on StandardXYItemRenderer in the sense that it was a copy-paste-modify process that created it. You'll see some common fields and methods between the two classes.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Help me.
I trying to use StackedXYAreaRenderer2 with TimeSeriesChart.
in my code.
It's simple.
But, it can't draw a chart.
in StackedXYAreaRenderer2 class.
this method called.
because TableXYDataset d has no data, min( is Double.POSITIVE_INFINITY) is greater than max( is Double.NEGATIVE_INFINITY).
so, new Range(min, max) throws IllegalArgumentException.
I want to make chart first. and then, add data periodical-ly.
Is there any solution without dataset have some data before creating a chart ??

I trying to use StackedXYAreaRenderer2 with TimeSeriesChart.
in my code.
Code: Select all
TimeTableXYDataset timeTableXYDataset = new TimeTableXYDataset();
JFreeChart jfreeChart = ChartFactory.createTimeSeriesChart(null, null, null, timeTableXYDataset, false, true, false);
XYPlot xyPlot = jfreeChart.getXYPlot();
StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
xyPlot.setRenderer(renderer);
But, it can't draw a chart.
in StackedXYAreaRenderer2 class.
Code: Select all
public Range findRangeBounds(XYDataset dataset) {
double min = Double.POSITIVE_INFINITY;
double max = Double.NEGATIVE_INFINITY;
TableXYDataset d = (TableXYDataset) dataset;
int itemCount = d.getItemCount();
for (int i = 0; i < itemCount; i++) {
double[] stackValues = getStackValues(dataset, d.getSeriesCount(), i);
min = Math.min(min, stackValues[0]);
max = Math.max(max, stackValues[1]);
}
return new Range(min, max);
}
because TableXYDataset d has no data, min( is Double.POSITIVE_INFINITY) is greater than max( is Double.NEGATIVE_INFINITY).
so, new Range(min, max) throws IllegalArgumentException.
I want to make chart first. and then, add data periodical-ly.
Is there any solution without dataset have some data before creating a chart ??
Tokdo belongs to Korea.
Not a 'sea of japan', But a 'East Sea(Dong hae)'
Not a 'sea of japan', But a 'East Sea(Dong hae)'