Skip to content

Commit

Permalink
Added a select all button
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed Nov 8, 2010
1 parent de0fb44 commit 5867340
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions public/javascripts/charts/sources.js
Expand Up @@ -278,6 +278,34 @@ WebivaStatsChart = function(opts) {
drawSourcesLegend('chart_bar_legend');
});


vis.add(pv.Panel)
.top(function() source_types.length * (fonts.check.size + fonts.check.spacing) + 22)
.width(fonts.check.size)
.height(fonts.check.size)
.left(0)
.fillStyle(null)
.anchor("center").add(pv.Label)
.font(fonts.check.font)
.anchor("right").add(pv.Label)
.textMargin(fonts.legend.margin/2)
.textAlign("left")
.font(fonts.legend.font)
.textStyle(fonts.legend.color)
.text('(select all)')
.events("all")
.event("click", function() {
for(var i=0; i<sources_to_display.length; i++) {
sources_to_display[i] = true;
}

for(var i=0; i<visits.length; i++) {
drawSources(i, 'chart_bar' + (i+1));
}

drawSourcesLegend('chart_bar_legend');
});

vis.render();
}

Expand Down

0 comments on commit 5867340

Please sign in to comment.