Skip to content

Commit 1d52168

Browse files
chfwchenjiandongx
authored andcommitted
🎨 minor update (pyecharts#645)
1 parent f1ba8c9 commit 1d52168

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pyecharts/charts/gauge.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
from pyecharts.chart import Chart
44

55

6+
DEFAULT_GAUGE_TOOLTIP_FORMATTER = "{a} <br/>{b} : {c}%"
7+
8+
69
class Gauge(Chart):
710
"""
811
<<< 仪表盘 >>>
@@ -33,7 +36,7 @@ def __add(
3336
"""
3437
kwargs.update(type="gauge")
3538
if "tooltip_formatter" not in kwargs:
36-
kwargs["tooltip_formatter"] = "{a} <br/>{b} : {c}%"
39+
kwargs["tooltip_formatter"] = DEFAULT_GAUGE_TOOLTIP_FORMATTER
3740
_min, _max = 0, 100
3841
if scale_range:
3942
if len(scale_range) == 2:

pyecharts/charts/geo.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from pyecharts.datasets.coordinates import get_coordinate
55

66

7+
DEFAULT_GEO_TOOLTIP_FORMATTER = "{b}: {c}"
8+
9+
710
class Geo(Chart):
811
"""
912
<<< 地理坐标系 >>>
@@ -93,7 +96,7 @@ def __add(
9396
assert len(attr) == len(value)
9497
kwargs.update(type="geo")
9598
if "tooltip_formatter" not in kwargs:
96-
kwargs["tooltip_formatter"] = "{b}: {c}"
99+
kwargs["tooltip_formatter"] = DEFAULT_GEO_TOOLTIP_FORMATTER
97100
chart = self._get_all_options(**kwargs)
98101

99102
if geo_cities_coords:

0 commit comments

Comments
 (0)