Hi all,
I encountered a problem, and here is the pic:
www . mybeast . info / ~fanrien / Volume.png
I have added the SegmentedTimeline to DateAxis in DomainAxis in XYPlot.
The bar data have gap on the days without real data.
JFreechart reserved space for non-trading days, and combined ex-data within.
I don't want that gap, could anybody help me??
Fanrien
Bar renderer with time series chart...
Here's a link to your pic
http://www.mybeast.info/~fanrien/Volume.png
Also, please read this
http://www.jfree.org/phpBB2/viewtopic.php?t=24715
I am assuming
1) You are using JFreeChart 1.0.9
2) You are using XYBarRenderer()
3) You are using TimeSeriesDataset
Try
If that doesn't work then it appears to be a bug in XYBarRenderer.
Here is the relevant code from XYBarRenderer
Unfortunately StartX will be a time that is less than the time segment so when it gets translated it gets truncated.
E.g.
Suppose your segment is 8am to 4pm
Your data is at 8.00
StartX = 8:00 - 1 min - 7:59
EndX = 8:00 + 1 min = 8:01
StartX lies outside the segment so it seems to be returning 8:00 for startX so the bar at the beginning of the segment is always thinner than the rest.
I would need to create a demo program to test the theory.
http://www.mybeast.info/~fanrien/Volume.png
Also, please read this
http://www.jfree.org/phpBB2/viewtopic.php?t=24715
I am assuming
1) You are using JFreeChart 1.0.9
2) You are using XYBarRenderer()
3) You are using TimeSeriesDataset
Try
Code: Select all
domainAxis = new DateAxis()
domainAxis.setTickMarkPosition( DateTickMarkPosition.START );
Here is the relevant code from XYBarRenderer
Code: Select all
double startX = intervalDataset.getStartXValue(series, item);
if (Double.isNaN(startX)) {
return;
}
double endX = intervalDataset.getEndXValue(series, item);
if (Double.isNaN(endX)) {
return;
}
if (startX <= endX) {
if (!domainAxis.getRange().intersects(startX, endX)) {
return;
}
}
else {
if (!domainAxis.getRange().intersects(endX, startX)) {
return;
}
}
RectangleEdge location = plot.getDomainAxisEdge();
double translatedStartX = domainAxis.valueToJava2D(startX, dataArea,
location);
double translatedEndX = domainAxis.valueToJava2D(endX, dataArea,
location);
E.g.
Suppose your segment is 8am to 4pm
Your data is at 8.00
StartX = 8:00 - 1 min - 7:59
EndX = 8:00 + 1 min = 8:01
StartX lies outside the segment so it seems to be returning 8:00 for startX so the bar at the beginning of the segment is always thinner than the rest.
I would need to create a demo program to test the theory.
The answer does not come from thinking outside the box, rather the answer comes from realizing the truth; There is no Box. my js site