Hi all,
I am using a XYPlot to display a time series dataset.
When the dateAxis is set with lowerMargin and upperMargin, the dataset is properly drawn with the defined 'offset' from the left and right boundary of the chart.
When the dataAxis is set with minimumDate and maximumDate (it means that only partial data in the dataset is drawn) at the same time, the partial data is properly drawn and quite fits to the screen.
However, the lowerMargin and upperMargin settings are NOT applied. i.e., if the data is displayed with candlestick, only HALF of the first and last drawn candlesticks are drawn next to the boundary of the chart (without the defined offset).
I wanna patch it. I have go via the codes a bit. However, I can't locate the code in which it takes care of such settings during rendering.
Can anyone give me some hints ?
Thanks.
Question on DateAxis set with lowerMargin and upperMargin
Re: Question on DateAxis set with lowerMargin and upperMargin
it would be too simple to say (like is there electricity question if your pc is not working) but have you tried setting the margins AFTER setting minDate, maxDate?
maybe you can also debug this method
maybe you can also debug this method
Code: Select all
org.jfree.chart.axis.ValueAxis.autoAdjustRange()
Re: Question on DateAxis set with lowerMargin and upperMargin
Not due to such kind of silly mistake.
I should say the required settings are injected and the behavior is not expected.
It should be a bug in the jfreechart.
I should say the required settings are injected and the behavior is not expected.
It should be a bug in the jfreechart.
Re: Question on DateAxis set with lowerMargin and upperMargin
setMimumumDate() and setMaximumDate() end up calling ValueAxis::setRange(...), you need to call ValueAxis::setRangeWithMargins(...) instead. I have never tried this and hopefully it will do the right thing with a segmentedTimeLine.
Re: Question on DateAxis set with lowerMargin and upperMargin
skunk wrote:setMimumumDate() and setMaximumDate() end up calling ValueAxis::setRange(...), you need to call ValueAxis::setRangeWithMargins(...) instead. I have never tried this and hopefully it will do the right thing with a segmentedTimeLine.
right.. line 633 DateAxis
silly me, i looked in setLowerMargin method for the problem =\