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 to implement tool tips in the Line chart #47

Closed
Seishin opened this issue Sep 19, 2014 · 2 comments
Closed

How to implement tool tips in the Line chart #47

Seishin opened this issue Sep 19, 2014 · 2 comments

Comments

@Seishin
Copy link

Seishin commented Sep 19, 2014

Hello!

I copy-pasted the LINE CHART WITH TOOLTIPS section example but the tooltips are not showing above the points as it's in the example. They're showing at the upper left corner without any style, just text.
jQuery and jQuery-ui are both included.

Any more dependencies?

Thanks!

@gionkunz
Copy link
Collaborator

Hi

The only thing to get this working is jQuery and only because it was the choice for the example. You could also use a different DOM library like $dom, MooTools or anything else.

For the specific example you only need jQuery and no jQuery UI.

The tooltips are not built into Chartist.js and currently you can only see the JavaScript code of the example. There is also a CSS part that you need to include in your code if you'd like to style your tooltip exactly the same. You can style the tooltip yourself or copy the styles with your browsers developer tools by inspection. The important part, and also why your tooltip has shown up at the same position always rather than moving with the pointer is that you need to set position: absolute on the .tooltip selector in your css.

Hope this helps.
Cheers
Gion

@Seishin
Copy link
Author

Seishin commented Sep 20, 2014

Thank you very much!
It really helped but it would be a good idea these little things to be explained in the documentation and examples sections.

@Seishin Seishin closed this as completed Sep 20, 2014
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

2 participants