InetSoft Product Information: Chart Control - Visual Properties

You can control the visual properties (font, alignment, background, etc.) of expanding cells, rows, and columns in the formula table script for your chart. There are three general steps:

1. Call functions to modify the visual properties of the “pre-expansion” table.

2. Call the “expandCalcTable()” function to expand formula table.

3. Call functions to modify the visual properties of the “post-expansion” table.

Any script that precedes the “expandCalcTable()” command applies to the table prior to expansion. Any script that follows the “expandCalcTable()” command applies to the expanded table. To use 'expandCalcTable()', make sure to disable automatic table expansion. (It is disabled by default for new reports.)

To disable automatic table expansion, select 'Report Properties' from the 'File' menu. In the 'Report Properties' dialog box, deselect 'Expand calc table automatically on script reference'.

dashboard demo
View a 2-minute demonstration of InetSoft's easy, agile, and robust BI software.

Walkthrough: Formula Table Expansion

Construct a formula table based on the 'customers' query, with a multilevel header comprising 'State' and 'City'.

1. Create a new report, and add a table with four rows and two columns.

2. Add the following text to the report's onLoad Handler script to store the results of the 'customers' query:

var q = runQuery('customers'); 

3. Select cell[1,0]. Right-click and select 'Format' from the context menu. This opens the 'Format' tab at the bottom. Click the Data tab for cell[1,0].

a. In the 'Binding' panel of the Data tab, select the 'Formula' option. Enter the formula 'toList(q['state'])'.

b. In the 'Expansion' panel of the Data tab, set 'Expand Cell' to expand 'Vertical'.

c. In the 'Cell' panel of the Data tab, set the 'Cell Name' to be “st”. The Data tab of the 'Format' panel should still be open.

4. Select cell[2,1].

a. In the 'Binding' panel of the Data tab, select the 'Formula' option. Enter the formula 'toList(q['city@state:$st'])'.

b. In the 'Expansion' panel of the Data tab, set 'Expand Cell' to expand 'Vertical'.

c. In the 'Cell' panel of the Data tab, set the 'Cell Name' to be “ct” and set the 'Row Group' to 'st'.

The table should appear as shown below.

 

 

toList(q['state'])

 

 

toList(q['city@state:$st'])

 

 

Pre-Expansion Script

In this example, you will format the 'State' rows with a red background color, and format the 'City' cells with a yellow background color. It is easiest to color these cells using pre-expansion script, because the formatting that you add to pre-expansion rows and cells is iterated for all corresponding rows and cells in the post-expansion table. Thus, the automatic table expansion takes the place of the Iteration Statements that you would otherwise need to write. To add the pre-expansion script, follow the steps below:

1. Select any cell of the table, right-click, and select 'Script' from the context menu. This opens the Script Editor to edit the element script.

2. Add the following script to the table element.

 rowBackground[1] = [255,0,0];
 cellBackground[2][1] = [255,255,0];
 expandCalcTable(); 

The first line of the script specifies a red background for the second row of the pre-expansion table (the row containing 'State'). The next line of the script specifies a yellow background for the cell in the third row, second column of the pre-expansion table (the row containing 'City'). The third line of the script initiates table expansion, which propagates the specified formatting to all corresponding cells in the expanded table.

3. Preview the result.

Post-Expansion Script

In this example, you will assign every fifth row of the table a thick border. This formatting should be applied to the post-expansion table, so you will place the code for this after the expandCalcTable() function.

1. Select any cell of the table, right-click, and select 'Script' from the context menu. This opens the Script Editor to edit the element script.

2. Add a “for” loop after the expandCalcTable() function. The full script should appear as follows:

 rowBackground[1] = [255,0,0];
 cellBackground[2][1] = [255,255,0];
 expandCalcTable();
   for (i=4; i<table.length; i+=5) {
    rowBorder[i] = StyleReport.THICK_LINE;
	 } 

3. Preview the result.

Read why choosing InetSoft's cloud-flexible BI provides advantages over other BI options.

More Articles About Visual Charts

Applying BI to a Higher Education Fundraising Call Center - So as we move into the demo, we are going to look at a call center system where there is a set of data tables. There are call records which are coming from the call system pictured by these blue cubes. There is alumni data. This is a higher education fundraising call center with a set of tables represented by the green cubes...

Common Vocabulary Around Data - We apply the same principles of a normal manufacturing supply chain to data, and the advantage of that is that executives speak that language. As we discuss supply chains, we are really establishing a common vocabulary around data that executives can understand. The advantage of that is that executives will be more likely to fund the data, more likely to support enterprise data, more likely to pay for the business intelligence tools around data that we need in order to manage it. So it's actually a really effective expectations management tool...

Dashboard Chart Creator - Our software allows you to quickly manage your data in a clear and concise way. Key benefits include the ability to: Use a small-footprint server that delivers web based interactive dashboards Share your information within your organization Have dashboards that range from monitoring and executive to sophisticated interactive visual analysis and business management Enhance manageability and agility...

Deploying Reports - Deployment of reports is simple with InetSoft's reporting software. Reports can be sent out to mass audiences at scheduled intervals to meet custom needs. View the information below to learn more about the Style Intelligence solution. This software's runtime does not require any special installation. It is provided as a set of library (.jar) files that are made accessible using the classpath. The sree.home parameter refers to the directory containing the configuration files and examples for your environment, and is specified as an initialization parameter in the Administrator Servlet and the Repository Servlet...

Evaluate InetSoft's Snowflake Reporting Tool - Looking for Snowflake reporting tools? InetSoft is a pioneer in self-service reporting and can mashup data in Snowflake with almost any other data source. View a demo and try interactive examples...

Previous: Formula Table Functions