Changing Scaling for a VisualFrame
A VisualFrame object contains information about how data values are mapped to physical properties of chart elements. For example, a BrightnessColorFrame contains information about how data values in a field map to the brightness of corresponding chart elements. Mappings of this type require a Scale.
To change the scaling of a VisualFrame object, simply assign a new Scale to the VisualFrame. For example, consider the following chart:
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.data)
var arr = [["State","Quantity","Total"],
["NJ",200,2500],
["NY",300,1500]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var frame = new BrightnessColorFrame();
frame.setField("Total");
frame.setColor(java.awt.Color(0xff0000));
elem.setColorFrame(frame);
graph.addElement(elem);
Note that in this chart the IntervalElement object implicitly defines a linear Y-axis scale. However, the data values on the chart are widely different in magnitude, which suggests that a log scale might be more appropriate.