Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Excanvas polyfill workflow #69

@Joran182to

Description

@Joran182to

Hi, I liked chart.js lib and wanted to use it in my React-based app, but I need to support IE8. So, I decided to use excanvas polyfill. It's not a problem to use it with chart.js itself, so it working like this in my app:
Rendering empty canvas:

    render() {
        return (
            <canvas ref="canvas" width="700" height="400"/>
        );
    }

And then initializing excanvas (which is loaded only in IE8 by conditional tags) and rendering chart into empty canvas:

    componentDidMount() {
        if (typeof G_vmlCanvasManager !== 'undefined') {
            G_vmlCanvasManager.initElement(this.refs.canvas);
            options.animation = false;
        }
        let ctx = this.refs.canvas.getContext("2d");
        let myLineChart = new Chart(ctx).Line(data, options);
    }

But chart components from react-chartjs creating canvas elements by itself, so I didn't found a way to initialize an excanvas polyfill. Is it possible to use excanvas with react-chartjs or I should use just a chart.js like now?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions