Skip to content

Commit

Permalink
Merge pull request #115 from mistercrunch/y_format
Browse files Browse the repository at this point in the history
Providing options for Y axis number formating
  • Loading branch information
mistercrunch committed Jan 16, 2016
2 parents d9e4c75 + 5910bf0 commit 8596390
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
15 changes: 12 additions & 3 deletions panoramix/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,16 @@ def __init__(self, viz):
description="Based on granularity, number of time periods to compare against"),
'compare_suffix': TextField('Comparison suffix',
description="Suffix to apply after the percentage display"),
'y_axis_format': TextField('Y axis format',
'y_axis_format': FreeFormSelectField('Y axis format',
default='.3s',
choices=[
('.3s', '".3s" | 12.3k'),
('.3%', '".3%" | 1234543.210%'),
('.4r', '".4r" | 12350'),
('.3f', '".3f" | 12345.432'),
('+,', '"+," | +12,345.4321'),
('$,.2f', '"$,.2f" | $12,345.43'),
],
description="D3 format syntax for y axis "
"https://github.com/mbostock/\n"
"d3/wiki/Formatting"),
Expand Down Expand Up @@ -360,9 +369,9 @@ def __init__(self, viz):
"Legend", default=True,
description="Whether to display the legend (toggles)"),
'x_axis_showminmax': BetterBooleanField(
"X show min/max", default=True,
"X bounds", default=True,
description=(
"Whether to display the min and max values of the axis")),
"Whether to display the min and max values of the X axis")),
'rich_tooltip': BetterBooleanField(
"Rich Tooltip", default=True,
description=(
Expand Down
5 changes: 2 additions & 3 deletions panoramix/static/panoramix.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,12 @@ var px = (function() {
url: '/r/shortner/',
data: {'data': '/' + window.location.pathname + slice.querystring()},
success: function(data) {
console.log(data);
data += '&nbsp;&nbsp;&nbsp;<a style="cursor: pointer;"><i class="fa fa-close" id="close_shortner"></a>';
$('#shortner').popover({content: data, placement: 'left', html: true, trigger: 'manual'});
$('#shortner').popover('show');
$('#close_shortner').click(function(){
$('#shortner').popover('destroy');
});

},
error: function() {alert("Error :(");},
});
Expand All @@ -262,7 +260,7 @@ var px = (function() {
}

$(".select2").select2({dropdownAutoWidth : true});
$(".select2Sortable").select2();
$(".select2Sortable").select2({dropdownAutoWidth : true});
$(".select2Sortable").select2Sortable({bindOrder: 'sortableStop'});
$("form").show();
$('[data-toggle="tooltip"]').tooltip({container: 'body'});
Expand Down Expand Up @@ -356,6 +354,7 @@ var px = (function() {
.select2({
createSearchChoice: create_choices,
initSelection: initSelectionToValue,
dropdownAutoWidth : true,
multiple: false,
data: l,
});
Expand Down

0 comments on commit 8596390

Please sign in to comment.