Updating Queries with Axis Labels / Pickers
Axis Labels or Axis Pickers are Zoomdata native controls that can be added to charts to provide a way for users to change query parameters dynamically.
Chart developers can these controls by calling the method controller.createaAxisLabel
.
The createAxislabel
method takes an object as its only argument with the following properties:
Option | Description |
---|---|
picks | Name of the query variable. Tip: Use the data accessorâs getName method to avoid hardcoding variable names |
position | Location of the axis label in the chart widget. Valid options: âbottomâ, âleftâ, ârightâ, âtopâ |
orientation | Orientation of the axis label text. Valid options: âverticalâ, âhorizontalâ |
Example:
controller.createAxisLabel({
picks: 'Group By',
position: 'bottom',
orientation: 'horizontal',
});
controller.createAxisLabel({
picks: 'Size',
position: 'bottom',
orientation: 'horizontal',
});
The above example adds two axis pickers to the chart that provide users with the ability to change the fields used for the âGroup Byâ and âSizeâ query variables.
The following image shows the axis pickers in their defined position and orientation: