Skip to content

Instantly share code, notes, and snippets.

@rbeene
Created May 11, 2012 04:19
Show Gist options
  • Save rbeene/2657503 to your computer and use it in GitHub Desktop.
Save rbeene/2657503 to your computer and use it in GitHub Desktop.
new Highcharts.Chart({
chart: {
renderTo: "market_share_scatter_by_companies"
},
title: {
text: "Market Share Analysis"
},
xAxis: {
type: "integer"
},
yAxis: {
min: 0,
allowDecimals: false,
title: {
text: "Impression Count",
}
},
series:
[{:name=>"Affymetrix", :x=>14, :y=>739181, :publisher_count=>4}]
Uncaught SyntaxError: Unexpected token :
,
tooltip: {
formatter: function(){
return this.series.name + ': Ad Count:' + this.x + " Publisher Count: " + this.publisher_count;
}
}
});
what they have
$(document).ready(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'scatter'
},
title: {
text: 'Height Versus Weight of 507 Individuals by Gender'
},
subtitle: {
text: 'Source: Heinz <i>et al.</i> 2003'
},
xAxis: {
minPadding: 0.1,
maxPadding: 0.1,
title: {
enabled: true,
text: 'Height (cm)'
}
},
yAxis: {
title: {
text: 'Weight (kg)'
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +' cm, '+ this.y +' kg';
}
},
legend: {
layout: 'vertical',
style: {
left: '100px',
top: '70px',
bottom: 'auto'
},
backgroundColor: '#FFFFFF',
borderWidth: 1
},
plotOptions: {
scatter: {
marker: {
radius: 5,
states: {
hover: {
enabled: true,
lineColor: 'rgb(100,100,100)'
}
}
},
states: {
hover: {
marker: {
enabled: false
}
}
}
}
},
series: [{
data: [{
x: 161.2,
y: 51.6,
marker: {
radius: 15,
fillColor: 'rgb(255, 0, 0)'
}
}, {
x: 167.5,
y: 59.0,
marker: {
radius: 5,
fillColor: 'rgb(0, 255, 0)'
}
}, {
x: 159.5,
y: 49.2,
marker: {
radius: 10,
fillColor: 'rgb(0, 0, 255)'
}
}]
}]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment