InetSoft Product Information: Drawing Graph

LegendSpec.setTitleVisible(boolean)

Specifies whether the legend title is visible.

Type
 boolean
 true: show title
 false: hide title
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"], ["NJ",200], ["NY",300]];
 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.setTitleVisible(false);
 frame.setLegendSpec(spec);
 elem.setColorFrame(frame);
 graph.addElement(elem);

LegendSpec.setVisible(Boolean)

Specifies whether the legend is visible.

Type
 Boolean
 true: show legend
 false: hide legend
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"], ["NJ",200], ["NY",300]];
 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.setVisible(false);
 frame.setLegendSpec(spec);
 elem.setColorFrame(frame);
 graph.addElement(elem);

TitleSpec.setLabel(value)

Specifies the title text.

Parameter
 value
 a String containing the label
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"], ["NJ", 200], ["NY", 300]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State", "Quantity");
 var spec = new TitleSpec();
 spec.setLabel("X Title")
 graph.setXTitleSpec(spec);
 graph.addElement(elem);

TitleSpec.setTextSpec(spec)

Specifies the title text attributes, such as color, font, format, etc.

Parameter
 spec
 a TextSpec object
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"], ["NJ", 200], ["NY", 300]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State", "Quantity");
 var titlespec = new TitleSpec();
 var textspec = new TextSpec();
 textspec.setColor(java.awt.Color(0xff0000));
 titlespec.setLabel("X Title")
 titlespec.setTextSpec(textspec);
 graph.setXTitleSpec(titlespec);
 graph.addElement(elem);
demo
Read how InetSoft saves money and resources with deployment flexibility.