InetSoft Product Information: Visualize Graph
LegendSpec.setPartial(boolean)
Specifies whether legend items can be ignored when there is insufficient space.
Type
boolean
true: ignore items exceeding legend size
false: compress items to fit (default)
Example (Report or Viewsheet)
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.coord)
importPackage(inetsoft.graph.guide.form)
var arr = [["State", "Quantity"], ["New Jersey",200],
["New York",300], ["Pennsylvania",120],
["Connecticut",450], ["New Mexico",200],
["Colorado",300], ["Oregon",200],
["Kentucky",300], ["California",100],
["Alaska",350], ["Alabama",200], ["Kansas",500],
["Texas",200], ["North Dakota",300],
["Maryland",200], ["Delaware",250],
["Washington",200], ["Vermont",75]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var frame = new CategoricalColorFrame();
frame.setField("State");
var spec = new LegendSpec();
spec.setPartial(true);
frame.setLegendSpec(spec);
elem.setColorFrame(frame);
graph.addElement(elem);