This is a simple addition to GridView that allows the user to provide arbitrary locations for the grid lines to draw. This came in handy trying to draw evenly spaced vertical lines that did not line up with major tics. I don't think this functionality was available anywhere else in a simple way, but please let me know if that's incorrect!
Here is the syntax for using this mode:
// set up plot and line locations
PlotPanel plot = ...
float[] hLines = ...
float[] vLines = ...
// add GridView with USER option
GridView gv = plot.addGrid();
gv.setHorizontal(Horizontal.USER); // these are actually unneccessary
gv.setVertical(Vertical.USER); // the setLineLocations methods set the mode to USER
gv.setVLineLocations(vLines);
gv.setHLineLocations(hLines);
The GridViewDemo class uses this mode to produce the following graph:
This is a simple addition to GridView that allows the user to provide arbitrary locations for the grid lines to draw. This came in handy trying to draw evenly spaced vertical lines that did not line up with major tics. I don't think this functionality was available anywhere else in a simple way, but please let me know if that's incorrect!
Here is the syntax for using this mode:
The
GridViewDemo
class uses this mode to produce the following graph: