VividCharts
Search…
Get Data

Using Get Data

After creating a VividChart object, associating it with its type and ensuring all required fields are used, get data is then used to query the table and return the data used to generate a chart. The exact format of the return will depend upon which chart type is associated with the VividChart object. See the documentation for your chosen chart type for specifics.
If used within a chart record script section there is a predefined variable called chartData that is used by the associated widget. To automatically use the widget associated with the chart type simply assign the result of get data to the chartData variable and the widget will take care of the rest.
Warning: Make sure the widget you are using is the same as the chart type associated with the VividChart object.

Getting data within a chart script

If within a chart script, the data can be assigned to chartData to be automatically used by the widget associated with the chart record.
Using get data within a script:
1
var vividChart = new VividChart(chart);
2
vividChart.setType('half donut');
3
chartData = vividChart.getData();
Copied!

Getting data using a custom variable

If used outside of a chart script get data may be assigned to any variable you select and then can be manipulated however desired.
Using get data without assigning to chartData:
1
var vividChart = new VividChart();
2
vividChart.setType('progress score');
3
vividChart.option('table', 'incident');
4
vividChart.option('conditions', 'impact>1');
5
var data = vividChart.getData();
Copied!
Last modified 8mo ago