Example usage for org.jfree.chart.fx ChartCanvas getScaleY

List of usage examples for org.jfree.chart.fx ChartCanvas getScaleY

Introduction

In this page you can find the example usage for org.jfree.chart.fx ChartCanvas getScaleY.

Prototype

public final double getScaleY() 

Source Link

Usage

From source file:net.sf.mzmine.chartbasics.ChartLogicsFX.java

/**
 * Find chartentities like JFreeChartEntity, AxisEntity, PlotEntity, TitleEntity, XY...
 * //from www.j  a  v  a2s .co m
 * @param chart
 * @return
 */
public static ChartEntity findChartEntity(ChartCanvas chart, double mx, double my) {
    // TODO check if insets were needed
    // coordinates to find chart entities
    int x = (int) (mx / chart.getScaleX());
    int y = (int) (my / chart.getScaleY());

    ChartRenderingInfo info = chart.getRenderingInfo();
    ChartEntity entity = null;
    if (info != null) {
        EntityCollection entities = info.getEntityCollection();
        if (entities != null) {
            entity = entities.getEntity(x, y);
        }
    }
    return entity;
}