Option

Using Option

The VividChart object can have any field associated with its chart type set by using the options method. The VividChart object will then use the value provided when it queries the table. Options is overloaded and can accept 3 different types of input.

Tips: Using options will override any fields provided by the chart object.

Using option to assign a field using a field name and value

Options can accept a string containing the chart field name to be used followed by a value representing the value to assign to the field.

Using options with a field name and value:

var vividChart = new VividChart(chart);
vividChart.setType('donut matrix');
vividChart.option('record_limit', 10);

Using option with a JavaScript object

Options can accept a JavaScript object which contains key/value pairs corresponding to chart fields and the values to use. This can accept more than one field option.

Using options with a JavaScript object.

var vividChart = new VividChart(chart);
vividChart.setType('donut');
vividChart.option({
    'record_limit': 10,
    'table': 'incident',
    'group_by': 'priority'});

Using option with JSON

Options can accept JSON which contains key/value pairs corresponding to chart field and the values to use. This can accept more than one field option.

Using options with JSON:

var vividChart = new VividChart();
vividChart.setType('arc score');
vividChart.option('{"table":"task", "conditions":"priority=1"}');

Last updated