visualization: format axis members before JSON serialization (#38908)

This commit is contained in:
Benjamin Dauvergne 2020-01-13 15:11:15 +01:00
parent 0ddd5530ac
commit 7e858006b6
1 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import re
import json
import hashlib
@ -299,10 +301,10 @@ class Visualization(object):
if len(self.drilldown) == 2:
(x_axis, y_axis), grid = self.table_2d()
cells = (([x.label, y.label], cell_value(grid[(x.id, y.id)])) for x in x_axis for y in y_axis)
cells = ((['%s' % x.label, '%s' % y.label], cell_value(grid[(x.id, y.id)])) for x in x_axis for y in y_axis)
elif len(self.drilldown) == 1:
axis, grid = self.table_1d()
cells = (([x.label], cell_value(grid[x.id])) for x in axis)
cells = ((['%s' % x.label], cell_value(grid[x.id])) for x in axis)
else:
raise NotImplementedError