Skip to content

Commit

Permalink
Fix issues w3c#13 and w3c#14
Browse files Browse the repository at this point in the history
  • Loading branch information
almossawi committed May 5, 2014
1 parent 8b0bb37 commit d2cd249
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions data/fake_users.json
Expand Up @@ -480,6 +480,10 @@
{
"date": "2014-04-30",
"value": 117956992
},
{
"date": "2014-05-01",
"value": 117956992
}
]
}
4 changes: 4 additions & 0 deletions data/some_percentage.json
Expand Up @@ -480,6 +480,10 @@
{
"date": "2014-04-30",
"value": 0.46305963624370283
},
{
"date": "2014-05-01",
"value": 0.46305963624370283
}
]
}
10 changes: 5 additions & 5 deletions js/metrics_graphics.js
Expand Up @@ -26,7 +26,7 @@ moz.defaults.all = {
min_y: null,
xax_count: 8,
yax_tick: 5,
yax_count: 4,
yax_count: 5,
axis_opacity: 0.3,
decimal: false,
xax_date_format: function(d) {
Expand Down Expand Up @@ -66,8 +66,8 @@ function moz_chart() {
.attr('height', args.height);

// determine the x bounds, given the data, or go with specified range
add_date_x(args);
add_value_y(args);
args = add_date_x(args);
args = add_value_y(args);

args.scalefns.xf = function(di) {
return args.scales.X(di[args.x_accessor]);
Expand Down Expand Up @@ -373,7 +373,7 @@ function goal_over(svg, args) {
}

var dd = new Date(+d[args.x_accessor]);
dd.setDate(dd.getDate() + 1);
dd.setDate(dd.getDate());

svg.append('text')
.classed('goals_rollover_text', true)
Expand Down Expand Up @@ -437,7 +437,7 @@ function which_version(date) {
function add_date_x(args) {
var min_x = args.min_x ? args.min_x : args.data[0][args.x_accessor];
var max_x = args.max_x ? args.max_x : _.last(args.data)[args.x_accessor];

args.scales.X = d3.time.scale()
.domain([min_x, max_x])
.range([args.left + args.buffer, args.width - args.right]);
Expand Down

0 comments on commit d2cd249

Please sign in to comment.