Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Canvas width / height problem #23

Closed
moberwasserlechner opened this issue Sep 19, 2016 · 1 comment
Closed

Canvas width / height problem #23

moberwasserlechner opened this issue Sep 19, 2016 · 1 comment
Assignees
Milestone

Comments

@moberwasserlechner
Copy link
Owner

I think below js code does not works as expected.

canvas.setAttribute('width', "100%");

Will investigate.

@moberwasserlechner
Copy link
Owner Author

I removed setting the canvas.width and canvas.height to 100% and use this instead.

        if (state.width > 0) {
            if (loggingEnabled) {
                console.log("chartjs: canvas width " + state.width);
            }
            canvas.setAttribute('width', state.width);
        }
        if (state.height > 0) {
            if (loggingEnabled) {
                console.log("chartjs: canvas height " + state.height);
            }
            canvas.setAttribute('height', state.height);
        }

If there was no width or height set. The Chart.Js should should get it from the parent container.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant