File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 44from ..utils import JSONEncoderForHTML
55
66class BaseMorrisChart (BaseChart ):
7- def get_data_json (self ):
7+
8+ def get_data (self ):
89 header = self .header
9- data_only = self .get_data ()[1 :]
10+ data = super (BaseMorrisChart , self ).get_data ()
11+ data_only = data [1 :]
1012 rows = []
1113 for row in data_only :
1214 rows .append (dict (zip (header , row )))
13-
14- return json .dumps (rows , cls = JSONEncoderForHTML )
15+ return rows
1516
1617 def get_category_key (self ):
1718 return self .header [0 ]
@@ -40,10 +41,10 @@ def chart_type(self):
4041
4142
4243class DonutChart (BaseMorrisChart ):
43- def get_data_json (self ):
44- data_only = self .get_data ()[ 1 :]
45-
46- return json . dumps ( [{"label" : el [0 ], "value" : el [1 ]} for el in data_only ], cls = JSONEncoderForHTML )
44+ def get_data (self ):
45+ data = super ( BaseMorrisChart , self ) .get_data ()
46+ data_only = data [ 1 :]
47+ return [{"label" : el [0 ], "value" : el [1 ]} for el in data_only ]
4748
4849 def chart_type (self ):
4950 return "Donut"
You can’t perform that action at this time.
0 commit comments