Skip to content

Commit

Permalink
bytemonk: Added tooltip sort to PieChartv2 panel (#659)
Browse files Browse the repository at this point in the history
* added tooltipSort to Piechartv2 Panel

* added tooltipSort to PieChartv2 Panel

---------

Co-authored-by: JamesGibo <22477854+JamesGibo@users.noreply.github.com>
  • Loading branch information
bytemonk and JamesGibo authored Jul 16, 2024
1 parent d4c10e9 commit 52c69c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ Changelog
x.x.x ?
=======

* Added ``tooltipSort`` parameter to PieChartv2 panel
* Fix mappings for Table
* Added support for AWS Cross-Account in CloudwatchMetricsTarget


0.7.1 2024-01-12
================

Expand Down
6 changes: 5 additions & 1 deletion grafanalib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3834,6 +3834,8 @@ class PieChartv2(Panel):
:param reduceOptionsValues: Calculate a single value per column or series or show each row
:param tooltipMode: Tooltip mode
single (Default), multi, none
:param tooltipSort: To sort the tooltips
none (Default), asc, desc
:param unit: units
"""

Expand All @@ -3849,6 +3851,7 @@ class PieChartv2(Panel):
reduceOptionsFields = attr.ib(default='', validator=instance_of(str))
reduceOptionsValues = attr.ib(default=False, validator=instance_of(bool))
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))

def to_json_data(self):
Expand All @@ -3873,7 +3876,8 @@ def to_json_data(self):
},
'pieType': self.pieType,
'tooltip': {
'mode': self.tooltipMode
'mode': self.tooltipMode,
'sort': self.tooltipSort
},
'legend': {
'displayMode': self.legendDisplayMode,
Expand Down

0 comments on commit 52c69c8

Please sign in to comment.