Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

XYDotRenderer does not register items with EntityCollection #16

Open
macyran opened this issue Mar 8, 2013 · 0 comments
Open

XYDotRenderer does not register items with EntityCollection #16

macyran opened this issue Mar 8, 2013 · 0 comments

Comments

@macyran
Copy link

macyran commented Mar 8, 2013

Adding the snippet below fixes the issue.

XYDotRenderer.java

public void drawItem(Graphics2D g2,
XYItemRendererState state,
Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState,
int pass) {
.....

        int domainAxisIndex = plot.getDomainAxisIndex(domainAxis);
        int rangeAxisIndex = plot.getRangeAxisIndex(rangeAxis);
        updateCrosshairValues(crosshairState, x, y, domainAxisIndex,
                rangeAxisIndex, transX, transY, orientation);

        EntityCollection entities = null;
        if(info != null) {
            ChartRenderingInfo chartInfo = info.getOwner();
            if(chartInfo != null) {
                entities = chartInfo.getEntityCollection();
            }
        }

        Rectangle entityArea = new Rectangle(xx,yy,this.dotWidth,this.dotHeight);

        if (entities != null && isPointInRect(dataArea, xx, yy)) {
            addEntity(entities, entityArea, dataset, series, item, xx, yy);
        }
    }

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

No branches or pull requests

1 participant