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

Legend only works if chart wrapped properly #21

Closed
jeffreybiles opened this issue Jun 3, 2015 · 2 comments · Fixed by #25
Closed

Legend only works if chart wrapped properly #21

jeffreybiles opened this issue Jun 3, 2015 · 2 comments · Fixed by #25

Comments

@jeffreybiles
Copy link
Contributor

When using the legend=true option, the ability of the legend to display is dependent upon the parent element of the chart.

    if (this.get('legend')) {
      var legend = chart.generateLegend();
      this.$().parent().append(legend);
    }

When the parent was the html body, the legend didn't show up. When I specifically wrapped the chart in a div, it showed up.

There are two ways I see of fixing this

  1. Document the requirement
  2. Have the legend put inside the chart component

Thanks for writing a great addon, and I hope this helps make it even better!

@aomran
Copy link
Collaborator

aomran commented Jun 5, 2015

@jeffreybiles thanks for reporting this!

Option 2 can't be done because the component is a <canvas> element so we can't put html in there. So we either document this better or change the component into a div with a canvas in it.

@jeffreybiles
Copy link
Contributor Author

Awesome, thanks!
On Jun 6, 2015 7:57 PM, "Ahmed Omran" notifications@github.com wrote:

Closed #21 #21 via #25
#25.


Reply to this email directly or view it on GitHub
#21 (comment).

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

Successfully merging a pull request may close this issue.

2 participants