Previous sections explained how to modify the data binding and element properties of an existing chart. This section explains how to create a new chart from the ground-up using Chart API commands.
In this example, you will create a new chart, define the chart data, and display the data on the chart. Follow the steps below.
importPackage(inetsoft.graph) importPackage(inetsoft.graph.aesthetic) importPackage(inetsoft.graph.coord) importPackage(inetsoft.graph.data) importPackage(inetsoft.graph.element) importPackage(inetsoft.graph.guide.form) importPackage(inetsoft.graph.scale) importPackage(inetsoft.graph.schema)
When you import a package, you can refer to its classes by their simple class names, e.g., HeatColorFrame(). If you do not import the package, then you need to use the fully-qualified class names, for example, inetsoft.graph.aesthetic.HeatColorFrame().
Tip: To reference chart data, use the DataSet object.
data = runQuery("sales by state");
In most cases, you will obtain the data from a query or data model by using runQuery(). You can also define your own dataset by passing a JavaScript array to the DefaultDataSet() method. EGraph is the global chart object, including all axes, legends, visual elements, etc.
graph = new EGraph();
graph.addElement(elem);
These are the basic operations required to create a chart from the ground-up using the Chart API. The complete script is shown below, along with the resulting chart.
importPackage(inetsoft.graph) importPackage(inetsoft.graph.aesthetic) importPackage(inetsoft.graph.coord) importPackage(inetsoft.graph.data) importPackage(inetsoft.graph.element) importPackage(inetsoft.graph.guide.form) importPackage(inetsoft.graph.scale) importPackage(inetsoft.graph.schema) data = runQuery("sales by state"); graph = new EGraph(); var elem = new IntervalElement("State", "Sales"); graph.addElement(elem);
Metrics for a Maker of Virtual Reality (VR) Products - As VR products continue to gain traction in the market, it becomes increasingly crucial for manufacturers to leverage data-driven insights to optimize performance, enhance user experience, and drive business growth. This necessitates the identification and tracking of key performance indicators (KPIs) and metrics tailored to the unique characteristics of the VR industry. Understanding KPIs and Metrics in the VR Industry: Before delving into specific KPIs and metrics, it's essential to grasp their significance within the context of VR product manufacturing. KPIs and metrics serve as quantifiable measures that gauge various aspects of business performance and provide actionable insights for decision-making. In the VR industry, these indicators offer invaluable guidance for assessing product effectiveness, market penetration, customer engagement, and overall business success...
Reviews About Business Dashboard Software - Since 1996 InetSoft has been an innovating developer of business dashboard software. To date, our software has been used by over 5,000 organizations across the world and has been embedded into commercial solutions of other ISVs and SaaS providers. Read customer and partner reviews on G2 Crowd and Software Advice: What I liked the most was the drag-and-drop feature for putting together a data query…with other solutions you have no choice but to sit and write code…but with Style Intelligence, it doesn't take two to three hours to design reports...
Top 10 Worthy Dashboard Solution - Priced to suit your organizations budget, InetSoft's dashboard solution combines competitive pricing with powerful tools. With our interactive dashboards, users will have a multi-dimensional solution that thoroughly prepares them for reporting and analyzing data sets. In addition to the multi-dimensional aspect of our dashboards, the user-friendly drag-and-drop design can be used with a wide range of sophisticated chart types...
Previous: Modifying a Chart Element using API Functions |
Next: Report Sections
|