toorshia / justgage

JustGage is a handy JavaScript plugin for generating and animating nice & clean dashboard gauges. It is based on Raphaël library for vector drawing.
MIT License
1.82k stars 461 forks source link

Didn't find a way to use this component in ReactJS components #379

Closed realJustinLee closed 1 year ago

realJustinLee commented 1 year ago
import {Component} from "react";
import React from "react";
import 'justgage'
class Gauge extends Component {
    componentDidMount() {
        this.guage = new JustGage({
            id: "guage",
            value: parseInt(this.props.value),
            min: parseInt(this.props.min),
            max: parseInt(this.props.max),
            title: this.props.title,
            label: this.props.label
        });
    }

    render() {
        return (
            <div id="guage"/>
        );
    }
}

export default Gauge;

Simply followed the samples and closed issue #315, but I got JustGage not defined and I just don't know how to solve this.