Skip to content

Commit

Permalink
Add code to update crosshairs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfree committed Feb 20, 2017
1 parent e4068be commit 29e0c08
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/org/jfree/chart/renderer/xy/XYBlockRenderer.java
Expand Up @@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
* (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
* (C) Copyright 2000-2017, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
Expand All @@ -27,7 +27,7 @@
* --------------------
* XYBlockRenderer.java
* --------------------
* (C) Copyright 2006-2016, by Object Refinery Limited.
* (C) Copyright 2006-2017, by Object Refinery Limited.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
Expand All @@ -41,6 +41,7 @@
* 07-Apr-2008 : Added entity collection code (DG);
* 22-Apr-2008 : Implemented PublicCloneable (DG);
* 03-Jul-2013 : Use ParamChecks (DG);
* 20-Feb-2017 : Add update for crosshairs (DG);
*
*/

Expand Down Expand Up @@ -382,7 +383,11 @@ public void drawItem(Graphics2D g2, XYItemRendererState state,
g2.setStroke(new BasicStroke(1.0f));
g2.draw(block);

EntityCollection entities = state.getEntityCollection();
int datasetIndex = plot.indexOf(dataset);
updateCrosshairValues(crosshairState, x, y, datasetIndex,
block.getCenterX(), block.getCenterX(), orientation);

EntityCollection entities = state.getEntityCollection();
if (entities != null) {
addEntity(entities, block, dataset, series, item, 0.0, 0.0);
}
Expand Down

0 comments on commit 29e0c08

Please sign in to comment.