Skip to content

Commit

Permalink
started work on speced#490. Separated the rollover text for the x and…
Browse files Browse the repository at this point in the history
… y accessor on line graphs using tspans. Next step is to implement the argument, then generalize this for the other graph types.
  • Loading branch information
hamilton committed Oct 13, 2015
1 parent 6c62903 commit f501bb2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
15 changes: 11 additions & 4 deletions dist/metricsgraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -3204,18 +3204,25 @@ MG.button_layout = function(target) {
.attr('y', (lineCount * lineHeight) + 'em')
.text('\u00A0');
} else {
// y rollover element.
if (args.time_series) {
textContainer.select('*').remove();

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

textContainer.append('tspan')
.text(fmt(dd) + ' ' + args.yax_units
+ num(d[args.y_accessor]));
.classed('mg-x-rollover-text', true)
.text(fmt(dd) + ' ');
textContainer.append('tspan')
.classed('mg-y-rollover-text', true)
.text(args.yax_units + num(d[args.y_accessor]));
}
else {
textContainer.append('tspan')
.text(args.x_accessor + ': ' + d[args.x_accessor]
+ ', ' + args.y_accessor + ': ' + args.yax_units
.text(args.x_accessor + ': ' + d[args.x_accessor] + ', ');
textContainer.append('tspan')
.text(args.y_accessor + ': ' + args.yax_units
+ num(d[args.y_accessor]));
}
}
Expand Down

0 comments on commit f501bb2

Please sign in to comment.