In the following example, you will bind a chart to the 'All Sales' query, set the axis bindings, define a subseries, and set grouping and summarization. Follow the steps below:
1. Add a new Chart element to the report.
For this example, do not open the 'Data Binding' dialog box. In the following steps, you will set the data source through the Chart's “query” property. In general, it does not matter how you initially configure the data binding, whether in script or through the 'Data Binding' dialog box. In either case, you can use the bindingInfo properties in script to modify the data binding.
2. Right-click an empty area of the report, and select 'Script' from the context menu. This opens the Script Editor for editing the onLoad Handler of the report. Enter the commands below.
3. Bind the chart to the 'All Sales'
query: Graph1.query = "All Sales";
4. Specify query fields to bind to the X-axis ('Company') and Y-axis ('Total'):
Graph1.bindingInfo.xFields = [["Company",Chart.STRING]];
Graph1.bindingInfo.yFields = [["Total",Chart.NUMBER]];
|
View a 2-minute demonstration of InetSoft's easy, agile, and robust BI software. |