InetSoft Product Information: Graph Data

InetSoft provides an API for developers to control every aspect of chart generation and user interfaces. This example below illustrates how the JavaScript-like API can be used to draw a chart dynamically.

Request a Demo
Register for Pricing
#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index Read More

GraphElement.addVar(field)

Add a variable to a GraphElement object. A variable is plotted on the Y-axis.

Parameter
field
 String containing name of variable
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", "Total"],
           ["NY",550,2500], ["NJ",370,3000]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new LineElement("State","Quantity");
elem.addVar("Total");
graph.addElement(elem);
why select InetSoft
“Flexible product with great training and support. The product has been very useful for quickly creating dashboards and data views. Support and training has always been available to us and quick to respond.
- George R, Information Technology Specialist at Sonepar USA

GraphElement.setCollisionModifier(value)

Specifies how collisions (elements occupying the same location) should be handled.

Parameter
value
 GraphElement.MOVE_NONE    (do not stack/center)
 GraphElement.MOVE_CENTER  (center, do not stack)
 GraphElement.MOVE_DODGE   (offset horizontal)
 GraphElement.MOVE_STACK   (offset vertical (stack))
 GraphElement.MOVE_JITTER  (random offset (points))
 GraphElement.DODGE_SYMMETRIC (offset horiz, center)
 GraphElement.STACK_SYMMETRIC (offset vert, center)
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], ["NJ", 300], ["NY", 300], ["NY", 100]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var scale = new LinearScale("Quantity");
var frame = new HeatColorFrame();
frame.setField("Quantity");
elem.setColorFrame(frame);
elem.setStackGroup(true);
elem.setCollisionModifier(GraphElement.STACK_SYMMETRIC);
graph.addElement(elem);
demo
Read how InetSoft saves money and resources with deployment flexibility.

GraphElement.setColorFrame(frame)

Specifies the aesthetic color treatment for the chart elements. A ColorFrame can color-code chart elements by value, or simply specify a static color scheme.

Parameters
frame
 a ColorFrame 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 frame = new HeatColorFrame();
var elem = new IntervalElement("State", "Quantity");
frame.setField("Quantity");
elem.setColorFrame(frame);
graph.addElement(elem);
Learn about the top 10 features of embedded business intelligence.

GraphElement.setInPlot(boolean)

Specifies whether the chart should be resized so that graph elements remain fully visible in the chart area.

Parameters
Boolean
 true: resize chart
 false: do not resize chart (crop elements)
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 scale = new LinearScale("Quantity");
scale.setMax(100);
graph.setScale("Quantity",scale);
elem.setInPlot(false);
graph.addElement(elem);
Previous: Mapping Between Axis Values