Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(How) can I change millisPerPixel on the fly while resizing? #71

Closed
AndrewSav opened this issue Apr 29, 2016 · 1 comment
Closed

(How) can I change millisPerPixel on the fly while resizing? #71

AndrewSav opened this issue Apr 29, 2016 · 1 comment

Comments

@AndrewSav
Copy link

AndrewSav commented Apr 29, 2016

When resizing the canvas, I'd like to millisPerPixel stay relative to the canva's width. Can I do that?

        var elem = document.getElementById("chart");
        var chart = new SmoothieChart({millisPerPixel: 1000 * 100 / elem.width, maxDataSetLength:2, grid: { millisPerLine: 1000, verticalSections: 1 }});

This way I always has 100 seconds of data worth on the chart with data points arriving one per second. The desire is to keep it this way even when the canvas is resized. Possible?

@AndrewSav AndrewSav changed the title (How) can I change millisPerPixel on the fly? (How) can I change millisPerPixel on the fly while resizing? Apr 29, 2016
@AndrewSav
Copy link
Author

Actually, I'm just being dumb here, I can change char.options on a live chart and it will do what I want. Sorry for the noise.

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

No branches or pull requests

1 participant