Open andyevansweather opened 6 years ago
Are you sure the size of your canvas element what you think it is? What I do is that I force the parent div to have a certain size.
<div style="width: 200px; height: 160px; margin: 0 auto">
<canvas id="TempGauge" gauge-js ng-model="temp" options="tempopt" style="width: 100%; height: 100%"></canvas>
<div class="gaugeLabel" style="float: right">
{{ A2Model.Temperature() }} <br/>
<span style="font-size: 8pt">deg C</span>
</div>
</div>
Never mind the AngularJS nomenclature, that's just me being lazy.
Anyway, my gauge renders beautifully.
Note also that opt.angle
is supposed to be a floating point number between -1 and 1. I've used angle: -0.2
is the example above. That being said, I think your issue is the size and scale of the canvas.
That was it for me ^
I just had to wrap it in a parent div with a fixed size that was wide / tall enough and then set the canvas height/width to 100%
Thanks!!
Hello,
The gauge is being clipped off at the bottom of the canvas element when I try and display a full gauge as a circle.
How to reproduce:
index.html
app.js
serve with http-server https://www.npmjs.com/package/http-server
Even when adjusting the height of the canvas, it is still clipped.
Any help would be greatly appreciated.