Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CrosshairOverlayFX NPE with CombinedDomainXYPlot #17

Open
zugaldia opened this issue Oct 31, 2020 · 0 comments
Open

CrosshairOverlayFX NPE with CombinedDomainXYPlot #17

zugaldia opened this issue Oct 31, 2020 · 0 comments

Comments

@zugaldia
Copy link

It seems that CrosshairOverlayFX currently doesn't support CombinedDomainXYPlot. When you add it as an overlay (viewer.canvas.addOverlay(crosshair)) it will issue a NPE because it's unable to find a valid plot instance here:

A potential solution is to let CrosshairOverlayFX accept the right plot in the constructor. In this case, and I'm not sure the best way to account for this, you'll also need to update the yy value computation (e.g. for vertical combined plots) so that the crosshair shows at the right height:

double yy = yAxis.valueToJava2D(y, dataArea, yAxisEdge);

For example, if the top chart has a weight of 2 and the bottom chart has a weight of 1, then the computation above needs to be multiplied by 2/3.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant