Skip to content

Instantly share code, notes, and snippets.

@kevinkraus92
Last active November 29, 2017 19:48
Show Gist options
  • Save kevinkraus92/baddb4c491522f5e61ccf312b420a89c to your computer and use it in GitHub Desktop.
Save kevinkraus92/baddb4c491522f5e61ccf312b420a89c to your computer and use it in GitHub Desktop.
compare costs
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="height: 400px; min-width: 310px; max-width: 600px; margin: 0 auto"></div>
<script>
Highcharts.chart('container', {
chart: {
type: 'bubble',
plotBorderWidth: 1,
zoomType: 'xy'
},
credits: {
enabled: false
},
legend: {
enabled: false
},
title: {
text: 'Nuevas locaciones'
},
subtitle: {
text: 'Analisis costo por hora vs tiempo viaje'
},
xAxis: {
gridLineWidth: 1,
title: {
text: 'Costo desarrollador por hora'
},
labels: {
format: '{value} USD'
}
},
yAxis: {
startOnTick: false,
endOnTick: false,
title: {
text: 'Tiempo de vuelo a ciudad'
},
labels: {
format: '{value}'
},
maxPadding: 0.2,
},
tooltip: {
useHTML: true,
headerFormat: '<table>',
pointFormat: '<tr><th colspan="4"><h3>{point.country}</h3></th></tr>' +
'<tr><th>Costo dev p/h:</th><td>{point.x}usd</td></tr>' +
'<tr><th>Tiempo vuelo:</th><td>{point.y}hs</td></tr>',
footerFormat: '</table>',
followPointer: true
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}'
}
}
},
series: [{
data: [
{ x: 47, y: 11, z: 10, name: 'DA', country: 'Dallas' },
{ x: 46, y: 11, z: 10, name: 'HO', country: 'Houston' },
{ x: 43, y: 9, z: 10, name: 'MI', country: 'Miami' },
{ x: 67, y: 11, z: 10, name: 'NYC', country: 'New York' },
{ x: 75, y: 16.35, z: 10, name: 'HO', country: 'San Francisco' },
{ x: 61, y: 15.45, z: 10, name: 'LA', country: 'Los Angeles' },
{ x: 55, y: 15, z: 10, name: 'CH', country: 'Chicago' },
{ x: 69, y: 15, z: 10, name: 'WA', country: 'Seattle' },
{ x: 56.5, y: 15, z: 10, name: 'DE', country: 'Denver' }
]
}]
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment