Skip to content

Commit

Permalink
added tooltipSort to TimeSeries Panel (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhat-sahab authored Sep 29, 2023
1 parent 6f36ce6 commit 1a0a0e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changelog
* added axisSoftMin and axisSoftMax options for TimeSeries
* Added support for Azure Data Explorer datasource plugin (https://github.com/grafana/azure-data-explorer-datasource)
* Added ``sortBy`` parameter to Table panel
* Added ``tooltipSort`` parameter to TimeSeries panel

.. _`Bar_Chart`: https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/bar-chart/
.. _`RateMetricAgg`: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-rate-aggregation.html
Expand Down
6 changes: 5 additions & 1 deletion grafanalib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,8 @@ class TimeSeries(Panel):
:param thresholds: single stat thresholds
:param tooltipMode: When you hover your cursor over the visualization, Grafana can display tooltips
single (Default), multi, none
:param tooltipSort: To sort the tooltips
none (Default), asc, desc
:param unit: units
:param thresholdsStyleMode: thresholds style mode off (Default), area, line, line+area
:param valueMin: Minimum value for Panel
Expand Down Expand Up @@ -2319,6 +2321,7 @@ class TimeSeries(Panel):
showPoints = attr.ib(default='auto', validator=instance_of(str))
stacking = attr.ib(factory=dict, validator=instance_of(dict))
tooltipMode = attr.ib(default='single', validator=instance_of(str))
tooltipSort = attr.ib(default='none', validator=instance_of(str))
unit = attr.ib(default='', validator=instance_of(str))
thresholdsStyleMode = attr.ib(default='off', validator=instance_of(str))

Expand Down Expand Up @@ -2379,7 +2382,8 @@ def to_json_data(self):
'calcs': self.legendCalcs
},
'tooltip': {
'mode': self.tooltipMode
'mode': self.tooltipMode,
'sort': self.tooltipSort
}
},
'type': TIMESERIES_TYPE,
Expand Down

0 comments on commit 1a0a0e8

Please sign in to comment.