public
Created

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
$(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]
}
]
});
});
});‚Äč

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.