InetSoft Product Documentation: Dashboard Code

TextSpec.setColor(value)

Specifies the text color.

Parameter
 value
 a java.awt.Color 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.

TextSpec.setFont(value)

Specifies the text font, as a string with the following form: 'FontFamily-FontStyle-FontSize'.

Parameter
 value
 a java.awt.Font 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.setFont(java.awt.Font('Verdana',
 java.awt.Font.BOLD, 14));
 titlespec.setLabel("X Title")
 titlespec.setTextSpec(textspec);
 graph.setXTitleSpec(titlespec);
 graph.addElement(elem);

TextSpec.setFormat(format)

Specifies how date or numeric data should be represented in string format for display.

Parameters
 format
 a java.text.Format 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",20000],["NY",30000]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State", "Quantity");
 var qscale = new LinearScale("Quantity");
 var aspec = new AxisSpec();
 var tspec = new TextSpec();
 tspec.setFormat(java.text.DecimalFormat("##,###.00"));
 aspec.setTextSpec(tspec);
 qscale.setAxisSpec(aspec);
 graph.setScale("Quantity", qscale);
 graph.addElement(elem);

TextSpec.setRotation(value)

Specifies the text rotation in degrees.

Parameters
 value
 a number of degrees
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",20000],["NY",30000]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State", "Quantity");
 var qscale = new LinearScale("Quantity");
 var aspec = new AxisSpec();
 var tspec = new TextSpec();
 tspec.setRotation(45);
 aspec.setTextSpec(tspec);
 qscale.setAxisSpec(aspec);
 graph.setScale("Quantity", qscale);
 graph.addElement(elem);
Read the top 10 reasons for selecting InetSoft as your BI partner.

Previous: Drawing Graph