Product Information: General Chart Properties
The following sections present the top-level components required to build a chart. These include the DataSet object, which encapsulates data from a JavaScript array, and the EGraph object, which represents the global chart object. The TextSpec, AxisSpec, LegendSpec, and TitleSpec objects are used by various other components to set formatting for text, axes, legends, and titles.
DataSet
The Dataset object contains the aggregated values that are displayed on the graph. It has the form of a two-dimensional array, where each column represents a distinct measure. You can specify the Dataset by one of the following methods:
- In Report Designer or Visual Composer, set the chart binding using the Chart Editor. (See Binding Data to a Chart Element in the Report Designer, or Creating a Chart in the Viewsheet.)
- In Report Designer or Visual Composer script, pass a JavaScript array to the DefaultDataSet constructor. dataset = DefaultDataSet(arr)
- In Visual Composer script, assign a Worksheet Data Block (e.g., 'LimitedProducts') to the Dataset. dataset = LimitedProducts;
- In Report Designer script, assign a query result (e.g., 'sales by state') to the Data property of the chart. This implicitly sets the Dataset as well.
data = runQuery("sales by state");
The Dataset object is also accessible for reading. See the getData() method for more information.
Example (Setting the Dataset):
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
var arr = [["State","Quantity"], ["CA",200], ["NY",3000]];
dataset = DefaultDataSet(arr)
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
graph.addElement(elem);
Full Name
inetsoft.graph.data.DataSet
DataSet.getData(column,row)
Returns the value in the DataSet object specified by the column and row indices. The first column (index 0) contains the X-axis labels.
Parameters
column
Column index of value to return
row
Row index of value to return
For example, consider a chart with two datasets (measures), as shown below:
Use dataset.getData(j,i) with row index i and column index j to access these plotted values. The DataSet.getRowCount() and DataSet.getColCount() functions provide the number of rows and columns of summarized data.
var str = "";
// Loop through rows
for (var i = 0; i < dataset.getRowCount(); i++) {
str = "";
// Loop through columns
for (var j = 0; j < dataset.getColCount(); j++) {
str += dataset.getData(j, i) + ",";
}
// Output the results
log(str); // Report Designer
alert(str); // Visual Composer
}
The following output is written by the log() function (for Report Designer) to the Console window:
Sun May 31 00:00:00 EDT 2009, 1.0, 4.0,
Mon Jun 01 00:00:00 EDT 2009, 2.0, 5.0,
Tue Jun 02 00:00:00 EDT 2009, 3.0, 6.0,
Wed Jun 03 00:00:00 EDT 2009, 4.0, 7.0,
The values in the first column (e.g., Sun...2009, Mon...2009, etc.) are the dates on the X-axis, while the second and third columns represent the two datasets (Measure 1 and Measure 2).
|
Read how InetSoft saves money and resources with deployment flexibility. |
More Articles About Charts
Beyond The Data Warehouse - Okay, move onto the next topic here. I think we have moved to a point where analytics have moved beyond the data warehouse. A data warehouse is obviously a good repository for certain types of functions within the organization. When we start talking about sound data of when we're talking customers calling in and the recordings of those customers and for trying to do sentiment analysis on those or categorizing calls or trying to analyze certain calls from the wider body of calls to find out what worked, what didn't work...
Channel Analytics - Omnichannel Performance: Analysts that specialize in customer operations evaluate the effectiveness of different customer communication channels including phone, email, chat, and social media. They improve customer experience across channels, optimize channel allocation, and find possibilities for automation or self-service by looking at channel-specific analytics...
Chemical Process Operator KPIs - Chemical process operators play a crucial role in ensuring the efficient and safe operation of chemical manufacturing processes. To effectively monitor and control these processes, operators track various key performance indicators (KPIs) related to production, quality, safety, and environmental compliance. Here are some common reporting KPIs that chemical process operators typically track...
Online Streaming Dashboard Example - This dashboard, created with Style Intelligence offered by InetSoft can provide video streaming companies with integrating data from multiple channels, helping to present trends, highlight comparisons and focus on problems, so that managers can find an entry point to observe complex data situations. When a large amount of real-time data is pouring into the database of stream video companies every day, the data modelling engine from InetSoft enables companies to quickly massage their data so that it is ready to create data visualizations. Inetsoft's focus in their products is ease of implementation...
Virtualization Serves That BI Dashboard - You could have some of information in a master data or a customer master but a lot of the rest of the information is being brought together through virtualization to eventually serve that BI dashboard. What data virtualization can do is either supplement or in some cases replace the need for physical replication and therefore provide virtualized data marts for reporting and dashboarding...
Wholesaler Dashboards - A bookkeeper at a wholesaler plays a crucial role in maintaining the financial records of the business. Enterprise dashboards are powerful tools that can significantly enhance their efficiency and effectiveness in this role. Here's a detailed explanation of how a bookkeeper at a wholesaler might utilize enterprise dashboards: Financial Reporting and Analysis: Enterprise dashboards are instrumental in providing a comprehensive overview of the financial health of the wholesaler. They allow the bookkeeper to generate reports on key financial metrics like revenue, expenses, profits, and cash flow. This enables them to make informed decisions and advise management on financial matters...