Skip to content

Instantly share code, notes, and snippets.

@theWhiteFox
Created July 29, 2016 12:39
Show Gist options
  • Select an option

  • Save theWhiteFox/538ebe4d7d620509f9a0b245fc34725e to your computer and use it in GitHub Desktop.

Select an option

Save theWhiteFox/538ebe4d7d620509f9a0b245fc34725e to your computer and use it in GitHub Desktop.
OXprXo
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.3/nv.d3.min.js"></script>
<script src="https://rawgit.com/enplore/nvd3-charts/master/gauge.js"></script>
<script src="https://rawgit.com/enplore/nvd3-charts/master/gaugeChart.js"></script>
<div id="gauge-chart">
<svg></svg>
</div>
nv.addGraph(function() {
var chart = nv.models.gaugeChart()
.title('Gauge')
.min(0)
.max(1);
d3.select('#gauge-chart svg')
.datum([Math.random()])
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
html, body {
width: 100%;
height: 100%;
}
#gauge-chart {
width: 100%;
height: 100%;
font-family: "Open Sans", Verdana;
}
#gauge-chart svg {
width: 100%;
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment