Created
October 19, 2012 03:02
-
-
Save camwest/3915994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
var chart; | |
$(document).ready(function() { | |
chart = new Highcharts.Chart({ | |
chart: { | |
renderTo: 'container', | |
type: 'area' | |
}, | |
title: { | |
text: 'Weekly Cohorts: States' | |
}, | |
xAxis: { | |
type: 'datetime', | |
}, | |
yAxis: { | |
title: { | |
text: 'Percent' | |
} | |
}, | |
tooltip: { | |
formatter: function() { | |
return this.series.name +': <b>' + Highcharts.numberFormat(this.y, 2) +' (' + Highcharts.numberFormat(this.percentage, 1) + '%)</b> for week ending '+ Highcharts.dateFormat('%b %d', this.x) | |
} | |
}, | |
plotOptions: { | |
area: { | |
stacking: 'percent' | |
} | |
}, | |
series: [ | |
{ | |
name: 'initial', | |
pointStart: Date.parse('2012-Sep-09'), | |
pointInterval: 7 * 3600000 * 24, // 7 day interval | |
data: [8, 15, 17, 137, 150, 200, 250] | |
}, | |
{ | |
name: 'embedded', | |
pointStart: Date.parse('2012-Sep-09'), | |
pointInterval: 7 * 3600000 * 24, // 7 day interval | |
data: [4, 10, 15, 150, 180, 250, 300] | |
}, | |
{ | |
name: 'active', | |
pointStart: Date.parse('2012-Sep-09'), | |
pointInterval: 7 * 3600000 * 24, // 7 day interval | |
data: [1, 2, 4, 35, 50, 70, 80] | |
}, | |
{ | |
name: 'deactive', | |
pointStart: Date.parse('2012-Sep-09'), | |
pointInterval: 7 * 3600000 * 24, // 7 day interval | |
data: [1, 2, 2, 12, 15, 17, 18] | |
} | |
] | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment