Sha256: 35e15687179a8cd9480e3624a13aed6983181d9b81184f923b5f1466645709e5
Contents?: true
Size: 752 Bytes
Versions: 8
Compression:
Stored size: 752 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { static values = { label: "Chart", idle: Number, used: Number, idleLabel: String, usedLabel: String, idleColor: "rgb(235, 235, 235)", usedColor: "rgb(54, 162, 235)" } connect() { const ctx = this.element new Chart(ctx, { type: 'doughnut', data: { labels: [this.usedLabelValue, this.idleLabelValue], datasets: [ { label: this.labelValue, data: [this.usedValue, this.idleValue], backgroundColor: [this.usedColorValue,this.idleColorValue], hoverOffset: 4 } ] }, options: { animation: false } }); } }
Version data entries
8 entries across 8 versions & 1 rubygems