Mikhus / canvas-gauges

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.
http://canvas-gauges.com/
MIT License
1.57k stars 394 forks source link

Will these guages work with Polymer Elements? #100

Open david6076 opened 7 years ago

david6076 commented 7 years ago

It does not work for me. There are no errors on the console. The canvas is visible in css inspector but the guage is not visible.

Mikhus commented 7 years ago

Hi there! Can you provide any examples? Thank you in advance.

david6076 commented 7 years ago

Here is the sample I have for radial guage. I know the script tag path is correct.

pinkflozd commented 7 years ago

it works for me if you use javascript to initialize the gauge

david6076 commented 7 years ago
<paper-card class="container">
  <div class="card-content">
      <script>
        var gauge = new LinearGauge({
            renderTo: document.createElement('canvas'),
            width: 160,
            height: 600,
            borderRadius: 20,
            borders: 0,
            barStrokeWidth: 20,
            minorTicks: 10,
            majorTicks: [0,10,20,30,40,50,60,70,80,90,100],
            value: 22.3,
            units: "°C",
            colorValueBoxShadow: false
        });
        document.body.appendChild(gauge.options.renderTo);
    </script>
  </div>
</paper-card>

This does not work either. Can you provide the script you used to display a gauge?

pinkflozd commented 7 years ago

here is one example https://gist.github.com/pinkflozd/0cc67bd4dd96133506a214efe5fef4a6

david6076 commented 7 years ago

Interesting. Thanks for the help.

On Mon, Jan 23, 2017 at 10:19 AM, Luka Karinja notifications@github.com wrote:

here is one example https://gist.github.com/pinkflozd/0cc67bd4dd96133506a214efe5fef4a6

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Mikhus/canvas-gauges/issues/100#issuecomment-274571908, or mute the thread https://github.com/notifications/unsubscribe-auth/AMiKzbX7CmBEx1SNA0ZB47zADZoHj2Yaks5rVO9DgaJpZM4LbP7S .