InetSoft Product Information: Chart Reference (API)

Are you looking for a reference for a chart API? InetSoft provides a JavaScript-like API in its enterprise charting solution. It is well-suited for cloud application developers to use to dynamically generate interactive charts for their end users. To review the API, see https://www.inetsoft.com/docs/2021/apidoc

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

Scale

The Scale object contains a scale defining the measurement of a dimension.

Scale.setAxisSpec(spec)

Specifies the axis properties for the scale.

Parameter

spec
 AxisSpec

Example (Report or Viewsheet)

importPackage(inetsoft.graph)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.coord)
 
var arr = [["State", "Quantity"], ["NJ",200], ["NY",300]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var qscale = new LinearScale("Quantity");
var elem = new IntervalElement("State", "Quantity")
var spec = new AxisSpec();
spec.setLineColor(java.awt.Color(0xff0000));
qscale.setAxisSpec(spec);
graph.setScale("Quantity", qscale);
graph.addElement(elem);

Scale.setDataFields(arr)

Specifies the fields to use for initializing the scale; i.e., determining the maximum and minimum values. If left unspecified, the values in the Scale.setFields(field) property are used for this purpose.

Parameter

arr
 Array of Strings

Example (Report or Viewsheet)

importPackage(inetsoft.graph)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.coord)
 
var arr = [["State","Quantity","Total"], ["NJ",100,0],
           ["NY",1500,30000]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var qscale = new LogScale();
var elem = new IntervalElement("State", "Quantity");
qscale.setDataFields(["Total"]);
graph.addElement(elem)
graph.setScale("Quantity", qscale);

Scale.setFields(field)

Specifies the fields to which the scale should be applied.

Parameter

field
 a String containing a column name
Example (Report or Viewsheet)
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.coord)
 
var arr = [["State","Quantity"],["NJ",100],["NY",4000]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var qscale = new LogScale();
var elem = new IntervalElement("State", "Quantity");
qscale.setFields(["Quantity"]);
var coord = new RectCoord(new CategoricalScale("State"),
            qscale)
graph.setCoordinate(coord);
graph.addElement(elem);

Scale.setScaleOption(value)

Specifies a scaling option for the default scaling. The Scale.TICKS and Scale.ZERO options determine the maximum and minimum values that are used to calculate the scale range.

The Scale.TICKS option uses the maximum and minimum tick values (i.e., rounded numbers) rather than the maximum and minimum data values. The Scale.ZERO option uses zero as the minimum rather than the minimum data value (if positive). To combine multiple options, use the pipe (“or”) operator:

qscale.setScaleOption(Scale.ZERO | Scale.TICKS);

Parameter

 value
  Scale.NO_NULL  (remove NULL-data gaps in scale) 
  Scale.TICKS    (use ticks in scale range calculation) 
  Scale.ZERO     (use zero in scale range)

Example (Report or Viewsheet)

importPackage(inetsoft.graph)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.coord)
 
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);
qscale.setScaleOption(Scale.ZERO);
graph.setCoordinate(coord);
graph.addElement(elem);
Read why choosing InetSoft's cloud-flexible BI provides advantages over other BI options.

More Articles About Charts

Best Practices for Planning Report Design - First, examine what data needs to be presented and decide which report elements will best capture the information. Make sure that the existing queries will provide the data in a usable form, subject to the modifications available during data binding. In some situations, queries are required for a particular report, but will not be used in other reports. These queries should be created as local queries, which are embedded and saved within the report (.srt) file, as opposed to global queries which are stored in the global registry. This avoids unnecessary clutter within the query registry. See Using a Local Query in Advanced Topics for more information...

BI Analysts Custom Object Problem - Business intelligence analysts need a unified meta-data layer to build reports and dashboards without the hassle of creating queries. The end-users also need this meta-data layer to create their own queries via the web. Any physical database schema that can be represented by a data model can be done entirely within the Query Builder. The first step is to define physical views of your database. These views include the tables and joins. The next step is to create logical models that map to the physical views. The advantage gained by creating a logical model is that it does not have to look anything like the physical view. The various entities and attributes can combine any fields from assorted tables, and alias them with better names...

InetSoft's Apache Business Intelligence Tool - InetSoft's pioneering dashboard reporting application produces great-looking web-based dashboards with an easy-to-use drag-and-drop designer. Maximize self-service for all types of users...

Put It All Together in an Analytic Environment - When it comes to social analytics, companies are trying to figure out how they can capture the data from Twitter, capture the data from blogs and from newspapers and various sources. Then they have to put it all together in an analytic environment to analyze sentiment and behaviors and feelings of people in order to be able to respond to them in the marketplace. If they don't like something, let's fix it. If they do like something, let's make a bigger advertising campaign around it...

Previous: Chart Reference