Modifying a Chart Element using API Functions

The Chart API provides access to charting engine commands using Java object syntax. You can use these commands to directly modify the graphical elements displayed by a Chart.

In this example, you will first create a chart by using the 'Data Binding' dialog box. You will then make further modifications to the display by using Chart API commands. Follow the steps below:

1. Add a new Chart element to the report.

2. Right-click the chart, and select 'Bind Data' from the context menu. This opens the 'Data Binding' dialog box.

3. Under the Data tab, select the 'All Sales' query.

4. Click the Chart tab. From the 'Available Columns' panel, drag the 'Employee' field to the 'X' region of the 'Data' panel.

View a 2-minute introduction to InetSoft's serverless BI solution.

5. Bind the 'Total' field so as to provide three different measures on the chart. Follow the steps below:

a. From the 'Available Columns' panel, drag the 'Total' field to the 'Y' region of the 'Data' panel.

b. Click the 'Edit Measure' button next to the 'Total' field. Set the 'Aggregate' to 'Max', and click the green 'Apply' button.

c. From the 'Available Columns' panel, drag the 'Total' field (again) to the 'Y' region of the 'Data' panel.

d. Click the 'Edit Measure' button next to the second 'Total' field. Set the 'Aggregate' to 'Min', and click the green 'Apply' button.

e. From the 'Available Columns' panel, drag the 'Total' field (again) to the 'Shape' region of the 'Visual' panel.

f. Click the 'Edit Measure' button next to the third 'Total' field. Set the 'Aggregate' to 'Average', and click the green 'Apply' button.

6. Click the 'Select Chart Style' button. Double-click to select the Point Style chart.

7. The 'Data Binding' dialog box should now appear as below:

8. Click 'Finish' to close the 'Data Binding' dialog box. Preview the report.

The chart shows maximum and minimum totals for each employee, and the chart shape-coding (interior fill) displays the average totals.

Note that the interior fill, 'Average(Total)', is the same for both datasets, so it is not needed in both locations. In the next steps, you will change the 'Min(Total)' markers to a solid red arrow-shape. You will also increase the size of the 'Max(Total)' markers so that the fill level is more visible. To make these changes, you will use the Chart API functions.

Note: Chart API script (which operates on the Chart's 'Egraph' property) should be placed in element scope. See Adding Element-Level Script for more information.

9. Create the required StaticShapeFrame, StaticColorFrame, and StaticSizeFrame objects.

// Import required Java packages:
importPackage(inetsoft.graph.aesthetic);
 
// Create arrow-shaped markers:
var shpframe = new StaticShapeFrame(GShape.ARROWBAR);
 
// Create static red color:
var colframe =
   new StaticColorFrame(java.awt.Color(0xFF0000));
 
// Create static size of 10 pixels:
var sizframe = new StaticSizeFrame(10);

10. Obtain a handle to each of the two datasets (element sets) by using the EGraph.getElement(index) method.

 var elem0 = graph.getElement(0); // Max point element
 var elem1 = graph.getElement(1); // Min point element 

11. Assign the visual frames to the appropriate data elements using the element's GraphElement.setShapeFrame(frame), GraphElement.setColorFrame(frame), and GraphElement.setSizeFrame(frame) properties.

elem1.shapeFrame = shpframe; // Min point element 
elem1.colorFrame = colframe; // Min point element 
elem0.sizeFrame = sizframe; // Max point element 

12. Close the Script Editor, and preview the report. The complete script is shown below, along with the resulting graph.

importPackage(inetsoft.graph.aesthetic);
var shpframe = new StaticShapeFrame(GShape.ARROWBAR);
var colframe =
   new StaticColorFrame(java.awt.Color(0xFF0000));
var sizframe = new StaticSizeFrame(10);
var elem0 = graph.getElement(0); // Max point element
var elem1 = graph.getElement(1); // Min point element
elem1.shapeFrame = shpframe;
elem1.colorFrame = colframe;
elem0.sizeFrame = sizframe;

More Resources About Charting

  • Requirements For The BI Platform

    This page publishes a real-world BI RFP submitted by a large nonprofit and shows how IoT-style requirements were organized for a modern self-service reporting solution. It walks through functional and nonfunctional requirements and highlights expectations for business-user-driven reporting, data security, and integration. Example responses from a vendor (InetSoft) are provided alongside each requirement so readers can compare needs to solution features. The document is structured to help procurement teams translate organizational goals into evaluable BI criteria. The sample RFP is practical for organizations seeking a template to speed vendor evaluation and clarify internal requirements.

  • Powerful Data Search Tools

    The article demonstrates Style Intelligence’s interactive report search capabilities and explains both basic and advanced search modes for mining large report sets. It illustrates how users can quickly filter, search, and retrieve specific rows or patterns inside complex reports without leaving the reporting UI. Examples and an interactive demo are provided so readers can experience on-the-fly searching and result refinement. The writeup emphasizes speed and scalability when summoning large volumes of data for analysis. Use cases include ad-hoc investigation, operational troubleshooting, and data validation workflows.

  • Looking To Start A Dashboard Trial

    This page invites prospective users to download a free evaluation of InetSoft’s web-based dashboard software and outlines what to expect from the trial. It lists typical uses—embedding for ISVs, enterprise deployments, and quick pilot rollouts—and points readers to demos and example dashboards. Practical guidance is included for managers evaluating dashboard proofs of concept and for developers embedding dashboards in applications. The page frames the trial as a low-friction way to validate fit before committing to production. It also directs visitors to additional resources and interactive examples to speed assessment.

  • Good Solution For Google Search Console Dashboarding

    This article showcases how InetSoft can ingest Google Search Console data and mash it up with other marketing and campaign sources to produce consolidated SEO dashboards. It describes visualization approaches—heatmaps, bubble charts, and multi-dimensional displays—that help spot ranking, appearance, and CTR trends. Step-by-step examples and a short demo are offered to show how SEO KPIs can be combined with other digital metrics. The guide targets marketing teams looking to centralize search performance monitoring alongside broader campaign analytics. It emphasizes ease of integration and interactive drill-down for SEO investigations.

  • Evaluate Feedback And References

    This guidance piece lists practical criteria for evaluating BI tools, with an explicit recommendation to seek customer feedback, references, and case studies during vendor selection. It breaks evaluation into technical, business, and support dimensions and offers checklists for validating vendor claims in production contexts. The content stresses comparing real-world experiences from customers in similar industries or with similar scale to reduce procurement risk. Readers are advised to probe performance, scalability, and total cost of ownership during trials. The article positions references as a linchpin for confident BI purchases.

  • Reporting Application That Can Track And Display

    This page promotes InetSoft’s free Individual and Business evaluation accounts and explains how a downloadable evaluation can help organizations judge reporting and dashboard capabilities. It highlights use cases where small teams want point-and-click visual analysis without large expenditures. The copy outlines how the evaluation lets users build dashboards, try interactive examples, and test self-service features before purchase. Practical tips for running a meaningful trial (sample datasets, KPIs to test) are included to help evaluators get accurate impressions. The page is aimed at teams seeking low-risk ways to vet reporting tools.

  • No Big Data Expertise Is Required

    This article explains an “intervals” dashboarding concept and positions InetSoft’s approach as a way to get big-data analysis without hiring specialized engineers. It argues that an appliance-style or bundled big-data solution removes the need for deep Spark/Hadoop expertise for basic visual analytics. The content outlines how administrators can deploy a managed cluster and let the visual analytic engine handle cluster configuration and resource allocation. It presents this as attractive for teams seeking big-data speed and scale while keeping operational complexity low. The writeup includes examples of analytics scenarios simplified by the intervals approach.

  • Companies Seeking A Consolidated Dashboard Software

    This page describes common drivers for organizations that need a consolidated dashboard platform—large volumes of dispersed data, multiple source systems, and the desire for unified KPIs. It explains architectural options and how a consolidated solution can centralize metrics while allowing role-based access and personalized views. Performance techniques (like optional data grid caches) are discussed as ways to scale dashboards without sacrificing interactivity. The article is practical for IT teams evaluating consolidation versus point solutions. It highlights the operational benefits of a single pane of glass for executive reporting and operational monitoring.

  • Looking To Download Dashboard Reporting Software

    This informational page gives an overview of InetSoft’s online dashboards and reporting product family and provides links to demos, downloads, and customer stories. It emphasizes the long history of the product line and the quick deployment model for self-service dashboards. Suggested evaluation steps, example dashboards, and links to visualization galleries are provided to help prospective users compare capabilities. The page encourages hands-on testing via the free evaluation to validate UX and integration options. It also points readers to customer testimonials about selecting the product for dashboard reporting needs.

  • For Application Providers Seeking Embeddable Reporting

    This page targets ISVs and enterprises that want a reporting solution that can be embedded into portals or packaged applications and explains how Style Intelligence supports deep UI customization. It outlines integration patterns, API surfaces, and deployment models that make embedding straightforward for application vendors. The content explains how embeddability reduces development time and lets vendors offer analytics as a native feature. Examples illustrate scenarios where reporting needs to match an application's look and feel while delivering self-service to end users. The page is useful for product teams seeking a ready-made reporting engine to accelerate feature delivery.

  • Tailored Insights That Align With Specific

    This writeup explains why businesses pursue custom dashboards to capture the precise operational and strategic signals that matter to their organization. It discusses integration of diverse data sources, bespoke KPI calculations, and role-based views as central benefits of customized dashboards. The article points to examples where tailored dashboards improved decision speed and visibility for line managers. Implementation considerations—data modeling, refresh cadence, and governance—are summarized to guide planning. The page positions custom dashboards as a means to deliver actionable, context-rich insight rather than generic charts.

  • Organizations Seeking Advanced Analytics Capabilities

    This guide surveys open-source analytics tools and compares their strengths for different types of users and use cases, helping teams seeking a cost-effective analytics stack. It covers lightweight visualization platforms and heavier data science frameworks, noting where each tool shines for exploratory analysis, dashboarding, or pipeline automation. The piece recommends matching technical skillsets and project goals to the appropriate toolset rather than assuming one open-source project fits all needs. Practical tips are provided for integrating open tools with commercial platforms when enterprise features are required. The guide is aimed at technical evaluators and architects planning an analytics roadmap.

We will help you get started Contact us