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

Already on GitHub? Sign in to your account

Line charts sometimes display nothing #1056

Open
wecing opened this Issue Aug 2, 2013 · 2 comments

Comments

Projects
None yet
2 participants

wecing commented Aug 2, 2013

Here's the source code of my demo:
https://gist.github.com/wecing/6134963

When you:

  1. feed the chart with very large numbers,
  2. re-render, then
  3. repeat step 1 but with very small numbers, and finally
  4. re-render again,
    the chart would display nothing.

@ghost ghost assigned tripp Aug 5, 2013

tripp added a commit to tripp/yui3 that referenced this issue Aug 12, 2013

Fix #1056. Charts weren't rendering properly when the dataProvider wa…
…s updated with large values and updated again with smaller values.
Contributor

tripp commented Aug 13, 2013

It looks like the #1079 may cause potential performance hits with some use cases. The fix will have to wait until the next sprint so that I can investigate and apply a performance neutral fix. In the interim, you can patch this issue by setting the graphic instance's resizeDown attribute to true before updating the dataProvider.

            var chart = new Y.Chart({
                type: 'line',
                dataProvider: myDataValues,
                render: "#chart-div"
            });
            chart.get("graph").get("graphic").set("resizeDown", true);

Thanks.

wecing commented Aug 13, 2013

Thanks.

BTW, it seems that resizeDown should not be set to true before first-time-rendering is done. So for those who is still using an old version of YUI which doesn't have a fix for this issue(or if the patch is not ready yet, like now) and do not supply an initial dataProvider field when creating the chart object, it's better to add that hot fix line after render().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment