Package org.swtchart

Examples of org.swtchart.Range


    public void handleEvent(Event event)
    {
        for (IAxis axis : chart.getAxisSet().getYAxes())
        {
            double coordinate = axis.getDataCoordinate(event.y);
            Range range = axis.getRange();

            double lower = 0;
            double upper = 0;

            if (event.count > 0)
            {
                lower = range.lower + 2 * ZOOM_RATIO * (coordinate - range.lower);
                upper = range.upper + 2 * ZOOM_RATIO * (coordinate - range.upper);
            }
            else
            {
                lower = (range.lower - 2 * ZOOM_RATIO * coordinate) / (1 - 2 * ZOOM_RATIO);
                upper = (range.upper - 2 * ZOOM_RATIO * coordinate) / (1 - 2 * ZOOM_RATIO);
            }

            axis.setRange(new Range(lower, upper));
        }
        chart.redraw();
    }
View Full Code Here

TOP

Related Classes of org.swtchart.Range

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.