-
Notifications
You must be signed in to change notification settings - Fork 33
howto change origin
Erich Seifert edited this page Sep 21, 2017
·
3 revisions
You can use the intersection property to move the origin to a certain position. This setting defines the intersection point of one axis with another (perpendicular) axis.
As an example, we take a standard x-y plot, which has its origin at (0, 0) by default. To move its origin to (–4, –2), we can use the following code:
// The x axis intersects the y axis at –2
AxisRenderer rendererX = plot.getAxisRenderer(XYPlot.AXIS_X);
rendererX.setIntersection(-2);
// The y axis intersect the x axis at –4
AxisRenderer rendererY = plot.getAxisRenderer(XYPlot.AXIS_Y);
rendererY.setIntersection(-4);How-to Move the y axis completely to the left or to the right