Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tooltipSort to TimeSeries Panel #631

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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 @@ -2217,6 +2217,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 @@ -2274,6 +2276,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 @@ -2334,7 +2337,8 @@ def to_json_data(self):
'calcs': self.legendCalcs
},
'tooltip': {
'mode': self.tooltipMode
'mode': self.tooltipMode,
'sort': self.tooltipSort
}
},
'type': TIMESERIES_TYPE,
Expand Down
Loading