Metric¶
The Metric object represents the measure object. One or more Metric objects can be passed as parameters to the .metrics() function. Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
The first metric in the example above is the count metric which is returned by default when no field and function is specified. The other metrics specify the measurement field and the aggregation function (operation) that the returned value represents. Example of aggregation functions are sum, avg, min, max, unique. You can see sample returned data here.
Hiding the aggreagation function¶
By default the metric aggregation function is displayed along with the metric label in the chart axis, legend, and tooltips. To only render the metric label and hide the aggregation function we can use the hideFunction()
method as shown below:
1 |
|
The picture below shows how metric functions are rendered by default:
The picture below shows how different chart elements render when the metric function is hidden: