Skip to content

Commit

Permalink
BigNumber tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 16, 2016
1 parent f1127a1 commit b594b8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 6 additions & 5 deletions panoramix/static/widgets/viz_bignumber.js
Expand Up @@ -9,12 +9,13 @@ px.registerViz('big_number', function(slice) {
slice.error(error.responseText);
return '';
}
json = payload.data;
var fd = payload.form_data;
var json = payload.data;
var color_range = [-1, 1];
var compare_pos = -23
var target_url = 'd3js.org';

var f = d3.format('.3s');
var f = d3.format(fd.y_axis_format);
var fp = d3.format('+.1%');
var width = slice.width();
var height = slice.height();
Expand Down Expand Up @@ -107,13 +108,13 @@ px.registerViz('big_number', function(slice) {
var y_axis = d3.svg.axis()
.scale(scale_y)
.orient('left')
.tickFormat(d3.format('.3s'))
.tickFormat(d3.format(fd.y_axis_format))
.tickValues(value_ext);
g.call(y_axis);
g.selectAll('text')
.style('text-anchor', 'end')
.attr('y','-5')
.attr('x','1');
.attr('y','-7')
.attr('x','-4');

g.selectAll("text")
.style('font-size', '10px');
Expand Down
5 changes: 5 additions & 0 deletions panoramix/viz.py
Expand Up @@ -561,6 +561,11 @@ class BigNumberViz(BaseViz):
'y_axis_format',
)
},)
form_overrides = {
'y_axis_format': {
'label': 'Number format',
}
}

def reassignments(self):
metric = self.form_data.get('metric')
Expand Down

0 comments on commit b594b8a

Please sign in to comment.