bernii / gauge.js

100% native and cool looking JavaScript gauge
MIT License
1.42k stars 391 forks source link

New feature: Add icon to tip of gauge pointer #133

Closed dmonaldo closed 7 years ago

dmonaldo commented 7 years ago

You can add an icon (image) to the tip of the gauge pointer with the iconPath and iconScale options. The icon also rotates with the angle of the pointer.

screen shot 2017-04-25 at 3 16 49 am screen shot 2017-04-25 at 3 19 25 am
// Gauge options
var opts = {
  angle: 0,
  lineWidth: 0.05,
  radiusScale: 0.5,
  pointer: {
    length: 0.5,
    strokeWidth: 0,
    color: '#000000',
    iconPath: 'rocketship.png', // Image path for icon
    iconScale: 0.5 // Relative icon size to image width/height
  }
};
sirushtij commented 6 years ago

How can i add the icon to each gauge bar