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

chart.setData(data).render() broken #174

Closed
WestleyArgentum opened this issue Oct 6, 2014 · 8 comments
Closed

chart.setData(data).render() broken #174

WestleyArgentum opened this issue Oct 6, 2014 · 8 comments
Labels

Comments

@WestleyArgentum
Copy link

Changing data and re-rendering causes ticks to break, Error: Invalid value for <g> attribute transform="translate(0,NaN)"

I'm using a grouped bar chart as in this fiddle: http://jsfiddle.net/gh/get/jquery/1.11.0/forio/contour/tree/master/examples/showcase/bar/bar-grouped

To reproduce, modify the fiddle to call setData and render like so:

chart = new Contour({
    ...
})
.cartesian()
.horizontal()
.bar(data)
.legend(data)
.tooltip()
.render();

chart.setData(data).render();  // just  re-rendering using the original data, nothing funny here

You'll see the most of the ticks disappear...

@WestleyArgentum
Copy link
Author

@jaimedp - possibly related to #160

@jaimedp
Copy link
Contributor

jaimedp commented Oct 6, 2014

Good catch!. This was exactly the issue in #160. This is now fixed as of 0.9.100, The samples in the showcase need to be updated to use latest version.

@jaimedp jaimedp closed this as completed Oct 6, 2014
@WestleyArgentum
Copy link
Author

Hey!

Unfortunately, I just downloaded 0.9.100 (from the github release) and I'm still seeing the problem...

But on closer inspection, the release that's tagged as 0.9.100 seems to give me contour.min.js with /*! Contour - v0.9.99 - 2014-08-14 */ at the top - so maybe I need to build from source? Is there a distribution of 0.9.100 somewhere else?

@mmrj
Copy link
Contributor

mmrj commented Oct 6, 2014

hi @WestleyArgentum try pulling again (0.9.104 release). we had a minor problem with the grunt script but Jaime fixed it : )

@WestleyArgentum
Copy link
Author

Hey @mmrj! Long time no see!

I just tried pulling and using the new dist - the tag at the top of contour.min.js is now 0.9.104, but I'm still having my original issue... It might be a little different from #160.

@jaimedp I'm having trouble uploading my code to github (depends on a large file, involves a server that streams data), but I'm not doing anything fancier than that gist + the chart.setData(data).render(); line. Are you sure it works there?

@jaimedp
Copy link
Contributor

jaimedp commented Oct 6, 2014

@WestleyArgentum you're right, this specific case is not fixed, the difference is if you include a xAxis categories array. To work around you could not specify the categories and instead provide a xAxis.labels.formatter function that renders the proper values. For example if your categories were ["A", "B", "C"], you do

...
xAxis: {
  labels: {
    formatter: function (d) {
      return myCategories[d];
    }
  }
}

I'm reopening this one.

@jaimedp jaimedp reopened this Oct 6, 2014
@WestleyArgentum
Copy link
Author

Wooo! Thanks!

@jaimedp jaimedp closed this as completed in 5794754 Oct 6, 2014
@mmrj mmrj added the verified label Oct 10, 2014
@mmrj
Copy link
Contributor

mmrj commented Oct 10, 2014

verified in 0.9.105

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

No branches or pull requests

3 participants