CT.14 Representing Multiple Measures

To represent multiple measures on a single chart, simply define a GraphElement object for each measure, and add the GraphElement to the Chart.

Consider the following script.

Note: Script that modifies 'graph' should be placed at the element level. See Adding Element-Level Script in Report Scripting and Adding Component Script in Dashboard Scripting for more information.

dataset = [["State", "Quantity 1", "Quantity 2"],["NJ",200,500], ["NY",300,1000],["PA",370,440], ["CT",75,20]];

graph = new EGraph();

var elem1 = new IntervalElement("State", "Quantity 1");

graph.addElement(elem1);

 

This creates a basic bar chart displaying the dimensions 'State' and 'Quantity 1'. To add the measure 'Quantity 2' to the chart as line element, follow the steps below:

1. Create a new LineElement to represent the graph of 'Quantity 2' vs. 'State'.

var elem2 = new LineElement("State", "Quantity 2");

2. Assign this new element to the main Chart object.

graph.addElement(elem2);

 

A legend is created automatically. To modify the legend, make changes to the VisualFrame's LegendSpec property. See Changing Legend Properties.

See Also

Changing Legend Properties, for more details about modifying legends.

Representing Data with Shape, Color, Size, to visually break out data as sub-series.

<< CT.13 Representing Data with Shape, Color, Size © 1996-2013 InetSoft Technology Corporation (v11.4) CT.15 Adding Decorative Elements >>