InetSoft Product Information: Chart JavaScript

EGraph.getCoordinate(index)

Parameter
 index
 Integer index of coordinate
Example (Report)
Bind a bar-type chart to the sample 'All Sales' query, with 'Company' (top 5) on the X-axis, and Sum(Total) on the Y-axis. Add the following script:
 var coord = graph.getCoordinate();
 coord.transpose();
Example (Viewsheet)
Create a Viewsheet based on the 'Sales Explore' Worksheet. Bind a bar-type chart with 'Company' (top 5) on the X-axis, and Sum(Total) on the Y-axis. Add the following script:
 var coord = graph.getCoordinate();
 coord.transpose();
view gallery
View live interactive examples in InetSoft's dashboard and visualization gallery.

EGraph.getElement(index)

Returns a handle to the GraphElement object specified by the index. This is useful in cases where the element was not explicitly assigned to a variable at creation time.

Parameter
 index
 Integer index of element
Example (Report)
Bind a bar-type chart to the sample 'All Sales' query, with 'Company' (top 5) on the X-axis, and Sum(Total) on the Y-axis. Add the following script:
 importPackage(inetsoft.graph.element)
 importPackage(inetsoft.graph.aesthetic)
 var elem = graph.getElement(0);
 elem.setHint(GraphElement.HINT_SHINE,'false');
Example (Viewsheet)
Create a Viewsheet based on the 'Sales Explore' Worksheet. Bind a bar-type chart with 'Company' (top 5) on the X-axis, and Sum(Total) on the Y-axis. Add the following script:
 importPackage(inetsoft.graph.element)
 importPackage(inetsoft.graph.aesthetic)
 var elem = graph.getElement(0);
 elem.setHint(GraphElement.HINT_SHINE,'false');
view demo icon
View a 2-minute demonstration of InetSoft's easy, agile, and robust BI software.

EGraph.getElementCount()

Returns the number of GraphElement objects currently on the chart

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","Total 1","Total 2"], ["NJ",200,500], ["NY",300,400]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 graph.addElement(new LineElement("State","Total 1"));
 graph.addElement(new LineElement("State","Total 2"));
 var elemCount = graph.getElementCount();
 for (var i=0;i
Previous: Chart Design