Creating a Chart Using an iScript

If possible, you should put a chart on a page definition. If not possible, then you can build a chart at runtime using an iScript and call the chart using a URL. Use the CreateObject function in the iScript instead of the GetChart function. You can then use the Chart class property “Html” to include the chart html in your application.

Note:

You can create only Chart, LedGauge, RatingGaugeChart, StatusMeterGauge, and SparkChart class charts using an iScript.

For example, this PeopleCode would build a chart using a standalone rowset:

Function IScript_GetChart()
local object &MYCHART;
local string &ChartHTML;

&MYCHART = CreateObject("Chart");
&MYCHART.SetData(xx);

/* xx will be a data row set */

&ChartHTML = &MYCHART.Html;

/* use &ChartHTML in your application */
...
End-Function;