Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 11, 2016
1 parent a4c7964 commit 4c8b275
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion panoramix/static/widgets/viz_table.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion panoramix/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -749,6 +749,7 @@ def get_json_data(self):

class NVD3TimeSeriesBarViz(NVD3TimeSeriesViz):
viz_type = "bar"
sort_series = True
verbose_name = "Time Series - Bar Chart"


Expand Down

0 comments on commit 4c8b275

Please sign in to comment.