Skip to content

Commit

Permalink
fixed conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
hamilton committed May 20, 2014
2 parents b7f9fa3 + 0e6e1a4 commit b8ac3d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 10 additions & 3 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,20 @@ $(document).ready(function() {
})

moz_chart({
title: "Extended Ticks",
description: "A longer chart with extended horizontal ticks enabled.",
title: "Extended Ticks, Custom Rollover",
description: "A wider chart with extended horizontal ticks enabled and a custom rollover text.",
data: data,
width: 960,
area: false,
xax_tick: 0,
y_extended_ticks: true,
rollover_callback: function(d, i) {
//custom format the rollover text, show days
var prefix = d3.formatPrefix(d.value);
$('.active_datapoint')
.html('Day ' + (i+1) + '   '
+ prefix.scale(d.value).toFixed(2) + prefix.symbol);
},
height: torso.height,
right: torso.right,
target: '#long',
Expand Down Expand Up @@ -144,7 +151,7 @@ $(document).ready(function() {
moz_chart({
left: 80,
bottom: 50,
title: "X-axis not time",
title: "X-axis Not Time",
description: "A chart where we're not plotting dates on the x-axis and where the axes include labels.",
data: data,
area: false,
Expand Down
6 changes: 5 additions & 1 deletion js/metrics-graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function merge_with_defaults(obj){
return obj;
};


var charts = {};

function moz_chart() {
Expand Down Expand Up @@ -62,6 +61,7 @@ function moz_chart() {
y_accessor: 'value',
y_label: '',
yax_units: '',
rollover_callback: null,
xax_format: function(d) {
//assume date by default, user can pass in custom function
var df = d3.time.format('%b %d');
Expand Down Expand Up @@ -651,6 +651,10 @@ charts.line = function(args) {
+ ', ' + args.y_accessor + ': ' + num(d[args.y_accessor]);
}
});

if(args.rollover_callback) {
args.rollover_callback(d, i);
}
}
}

Expand Down

0 comments on commit b8ac3d8

Please sign in to comment.