diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cf0c30de..51c7e66d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/grafanalib/core.py b/grafanalib/core.py index 4192806b..42d2ee68 100644 --- a/grafanalib/core.py +++ b/grafanalib/core.py @@ -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 @@ -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)) @@ -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,