Skip to content

Commit 1a0a0e8

Browse files
authored
added tooltipSort to TimeSeries Panel (#631)
1 parent 6f36ce6 commit 1a0a0e8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Changelog
2020
* added axisSoftMin and axisSoftMax options for TimeSeries
2121
* Added support for Azure Data Explorer datasource plugin (https://github.com/grafana/azure-data-explorer-datasource)
2222
* Added ``sortBy`` parameter to Table panel
23+
* Added ``tooltipSort`` parameter to TimeSeries panel
2324

2425
.. _`Bar_Chart`: https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/bar-chart/
2526
.. _`RateMetricAgg`: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-rate-aggregation.html

grafanalib/core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,6 +2262,8 @@ class TimeSeries(Panel):
22622262
:param thresholds: single stat thresholds
22632263
:param tooltipMode: When you hover your cursor over the visualization, Grafana can display tooltips
22642264
single (Default), multi, none
2265+
:param tooltipSort: To sort the tooltips
2266+
none (Default), asc, desc
22652267
:param unit: units
22662268
:param thresholdsStyleMode: thresholds style mode off (Default), area, line, line+area
22672269
:param valueMin: Minimum value for Panel
@@ -2319,6 +2321,7 @@ class TimeSeries(Panel):
23192321
showPoints = attr.ib(default='auto', validator=instance_of(str))
23202322
stacking = attr.ib(factory=dict, validator=instance_of(dict))
23212323
tooltipMode = attr.ib(default='single', validator=instance_of(str))
2324+
tooltipSort = attr.ib(default='none', validator=instance_of(str))
23222325
unit = attr.ib(default='', validator=instance_of(str))
23232326
thresholdsStyleMode = attr.ib(default='off', validator=instance_of(str))
23242327

@@ -2379,7 +2382,8 @@ def to_json_data(self):
23792382
'calcs': self.legendCalcs
23802383
},
23812384
'tooltip': {
2382-
'mode': self.tooltipMode
2385+
'mode': self.tooltipMode,
2386+
'sort': self.tooltipSort
23832387
}
23842388
},
23852389
'type': TIMESERIES_TYPE,

0 commit comments

Comments
 (0)