Skip to content

Instantly share code, notes, and snippets.

@camwest
Created October 19, 2012 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camwest/3915994 to your computer and use it in GitHub Desktop.
Save camwest/3915994 to your computer and use it in GitHub Desktop.
$(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