InetSoft Product Information: Graph JavaScript

EGraph.setLegendLayout(value)

Specifies the chart legend's position.

Parameter
 value GraphConstants.BOTTOM    // below chart data
 GraphConstants.TOP             // above chart data
 GraphConstants.RIGHT           // right of chart
 GraphConstants.LEFT            // left of chart
 GraphConstants.IN_PLACE        // floated on chart
 GraphConstants.NO_LEGEND       // no legend
Example (Report or Viewsheet)
 importPackage(inetsoft.graph)
 importPackage(inetsoft.graph.data)
 importPackage(inetsoft.graph.element)
 importPackage(inetsoft.graph.aesthetic)
 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");
 elem.setColorFrame(frame);
 graph.setLegendLayout(GraphConstants.BOTTOM);
 graph.addElement(elem);
view gallery
View live interactive examples in InetSoft's dashboard and visualization gallery.

EGraph.setCoordinate(coord)

Sets the specified Coordinate for the chart. See Chart Coordinates & Scaling for available coordinate types.

Parameter
 coord
 a Coordinate 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 sscale = new CategoricalScale("State");
 var qscale = new LinearScale("Quantity");
 var coord = new RectCoord(sscale,qscale);
 coord.transpose();
 graph.setCoordinate(coord);
 graph.addElement(elem);
view demo icon
View a 2-minute demonstration of InetSoft's easy, agile, and robust BI software.

EGraph.setScale(field, scale)

Sets the specified Scale for the given axis. See Chart Coordinates & Scaling for available scales.

Parameters
 field
 name of axis to receive scale (String)
 scale
 scale to apply to axis (Scale)
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 LineElement("State", "Quantity");
 var qscale = new LinearScale("Quantity");
 qscale.setMin(100);
 qscale.setMax(500);
 graph.addElement(elem);
 graph.setScale("Quantity", qscale);
Previous: Chart JS