Version: jfreechart 0.9.2
Topic: setting crosshair value in XY-Plot
Problem: You can set the crosshair value for the value and category
axis, but it will be overwritten by the crosshair info, even when the
crosshairLockedOnData value is false.
?? Is this a bug or a feature ??
The VerticalCategoryPlot behaves different and takes the crosshair value of the axis.
Solution: to bypass the problem, I only reset the crosshair value depending on the crosshairLockedOnData switch.
----------------------------------------------------------------------------------------------
// draw vertical crosshair if required...
if( domainAxis.isCrosshairLockedOnData() == true ) // Crosshair locked on data returns the last crosshair
domainAxis.setCrosshairValue(crosshairInfo.getCrosshairX());
if (domainAxis.isCrosshairVisible()) {
this.drawVerticalLine(g2, dataArea, domainAxis.getCrosshairValue(),
domainAxis.getCrosshairStroke(),
domainAxis.getCrosshairPaint());
}
// draw horizontal crosshair if required...
if( rangeAxis.isCrosshairLockedOnData() == true )
rangeAxis.setCrosshairValue(crosshairInfo.getCrosshairY());
if (rangeAxis.isCrosshairVisible()) {
this.drawHorizontalLine(g2, dataArea, rangeAxis.getCrosshairValue(),
rangeAxis.getCrosshairStroke(),
rangeAxis.getCrosshairPaint());
}
----------------------------------------------------------------------------------------------
Thanx for feedback
Eveline