Skip to content

CrosshairOverlayFX NPE with CombinedDomainXYPlot #17

@zugaldia

Description

@zugaldia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions