API Documentation Excerpt
You can create a basic two-dimensional representation of data with just a GraphElement object. To represent
additional dimensions by using other visual attributes of elements, create a VisualFrame.
To understand how to use a VisualFrame, consider the script below (Note: Report script that modifies 'graph'
should be placed at the element level. See Adding Element-Level Script)
importPackage(inetsoft.graph):
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.coord)
importPackage(inetsoft.graph.data)
var arr = [["State","Quantity","Total"],
["NJ",200,2500],["NY",300,1500]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new PointElement("State", "Quantity");
graph.addElement(elem);
This creates a basic point (scatter) chart displaying the dimensions 'State' and 'Quantity'. If you want to
additionally represent the dimension 'Total' with the element size, use a VisualFrame such as the
LinearSizeFrame. Follow these steps:
Create a new LinearSizeFrame object, and specify the field containing the data that will determine the
element sizes.
var frame = new LinearSizeFrame();
frame.setField("Total");
A VisualFrame object such as LinearSize?Frame contains a map?ping between data values and physical
attributes. Therefore, you need a Scale to specify the mapping's scaling.
Create a new LinearScale object, and assign the scale properties. (See Appendix CT.2, Changing Chart
Scaling, for more information.)
var scale = new LinearScale();
scale.setFields("Total");
scale.setMax(3000);
scale.setMin(1000);
Assign the new Scale to the VisualFrame object:
frame.setScale(scale);
Assign the VisualFrame object to the GraphElement object:
elem.setSizeFrame(frame);
The point sizes now represent the data values contained in the 'Total' field. The complete script is shown
below.
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.coord)
importPackage(inetsoft.graph.data)
var arr = [["State","Quantity","Total"],
["NJ",200,2500],["NY",300,1500]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new PointElement("State", "Quantity");
var frame = new LinearSizeFrame();
frame.setField("Total");
var scale = new LinearScale();
scale.setFields("Total");
scale.setMax(3000);
scale.setMin(1000);
frame.setScale(scale);
elem.setSizeFrame(frame);
graph.addElement(elem);
More Articles About Charting
Abscission Agent Production Metrics - When considering Business Intelligence (BI) metrics tracked by these companies, the focus shifts towards optimizing production, ensuring regulatory compliance, maintaining safety, and managing costs. Here are key BI metrics tracked by Abscission Agent Production companies, along with their definitions and significance in performance management...
Metrics Measured on a Post-Mortem Dashboard - A post-mortem dashboard is an effective tool that gives organizations the ability to assess their performance after the conclusion of a project, event, or other major activity. It offers insightful information on what worked well and what may be improved for next attempts. A post-mortem dashboard uses a variety of Key Performance Indicators (KPIs) and analytics to efficiently evaluate a project's progress...
Pet Supplies Company KPIs - An analyst at a pet supplies company plays a critical role in monitoring and optimizing various aspects of the business. They track key performance indicators (KPIs) to assess the company's performance, identify areas for improvement, and support strategic decision-making. Here are some KPIs that an analyst at a pet supplies company might track: Sales Revenue: Total revenue generated from the sale of pet supplies, including food, toys, accessories, and grooming products. This KPI helps assess overall business performance and growth trends...
Tracking Human Resources Key Performance Indicators - InetSoft's business intelligence software can be used to track any HR Key Performance Indicator (KPI). For example, you may need to chart average number of training hours per employee, staff turnover, average training costs per employee, and HR FTE to total FTE ratio. InetSoft offers KPI tracking software that is...
Types of Dashboards for ServiceNow Users - This type of dashboard displays data about a company's entire workflow. It includes metrics such as customer satisfaction scores, employee performance, and sales numbers. It lets you see how well your business is performing at any given moment. It shows you where you stand compared to your goals, and gives you a clear picture of what needs to happen next. The best thing about a process dashboard is that it helps you stay focused on what matters most. It's easy to tell when things aren't running smoothly. You might notice that your sales team isn't meeting its quota, or that your customer service representatives aren't answering calls as quickly as they used to. And if you want to know whether your customer service department is keeping customers happy, you can use the information to improve training programs...