Skip to content

Visualization Options

After creating a new visual, or during its initialization, a number of options can be set in order to modify it. These options can be passed to the visual by using the .set() method, and it can be done in two ways. The first way is passing two parameters to the set() method, where the first one is the name of the option, and the second one is the value:

1
2
myChart.set('legend','right')
        .set('axisLabel', false)

The other way is by passing a JSON object with pairs option-value:

1
2
3
4
5
6
var options = {
        'legend': 'right',
        'axisLabel': false
}

myChart.set(options)

We may have an interactive application where we can set options dynamically, without rebuilding the visual. In these cases we may want to delete options that are not applicable from one chart to another, i.e: dataZoom. In these cases we can unset the options like this:

1
myChart.set('dataZoom','unset')