From 4c8b275f8837b23dd1a606fac9d959addb458165 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Sun, 10 Jan 2016 20:53:57 -0800 Subject: [PATCH] Minor tweaks --- panoramix/static/widgets/viz_table.js | 6 +++++- panoramix/viz.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/panoramix/static/widgets/viz_table.js b/panoramix/static/widgets/viz_table.js index 5baaa67d94b25..bbb17e04e9442 100644 --- a/panoramix/static/widgets/viz_table.js +++ b/panoramix/static/widgets/viz_table.js @@ -1,9 +1,10 @@ px.registerViz('table', function(slice) { var data = slice.data; var form_data = data.form_data; + var f = d3.format('.3s'); + var fC = d3.format('0,000'); function refresh() { - var f = d3.format('.3s'); $.getJSON(slice.jsonEndpoint(), function(json){ var data = json.data; var metrics = json.form_data.metrics; @@ -42,6 +43,9 @@ px.registerViz('table', function(slice) { return "linear-gradient(to right, lightgrey, lightgrey " + perc + "%, rgba(0,0,0,0) " + perc + "%"; } }) + .attr('title', function(d){ + return fC(d.val); + }) .attr('data-sort', function(d){ if (d.isMetric) return d.val; diff --git a/panoramix/viz.py b/panoramix/viz.py index efcf51b460c02..d803e5b219fb3 100644 --- a/panoramix/viz.py +++ b/panoramix/viz.py @@ -536,7 +536,7 @@ def get_json_data(self): for k, v in series.items(): chart_data.append({ 'key': k, - "color": utils.color(k), + "color": utils.color(str(k)), 'values': v }) return dumps({ 'chart_data': chart_data, @@ -749,6 +749,7 @@ def get_json_data(self): class NVD3TimeSeriesBarViz(NVD3TimeSeriesViz): viz_type = "bar" + sort_series = True verbose_name = "Time Series - Bar Chart"