Is it possible to link to an url when click on the chart ?
See original GitHub issueHello,
Thank you for this tool! it’s amazing! I’m newbie in rails / chartkick.
I’m currently using pie charts, and I’m wondering if there is a way I can get each section of my pie chart to navigate to an url.
I would like to know if it is possible / there is a way to , on clicking on the graph, it open an url link ? So if is there a way let me know. thanks!!!
<h1>Pie Chart</h1>
<div id="chart-2" style="height: 300px;"></div>
<script>
new Chartkick.PieChart("chart-2", [["Blueberry",44, "http://link1.com"],
["Strawberry",23, "http://link2.com"],
["Banana",22, "http://link3.com"],
["Apple",21, "http://link4.com"],
["Grape",13, "http://link5.com"]]);
</script>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (2 by maintainers)
Top Results From Across the Web
chart.js - link to other page when click on specific section in chart
So I want to click on a slice in the pie chart. The slice should act as a normal link to another page...
Read more >How to insert links in charts, maps & tables
You can't add links to bylines. Here is a chart with links in different locations. You can hover over the chart and click...
Read more >How to Add Links and Graphics to Your Charts - YouTube
Select 'add/change link ' in the chart editor, copy the URL, and apply. You can do the same with images and icons.
Read more >Click on chart to activate hyperlink EXCEL - Super User
1 Answer 1 · Select your chart · Insert > Links > Insert Link (bottom of your list) opens the standard Insert Hyperlink...
Read more >HOWTO: Add links to your charts - RGraph
A guide for adding links to your charts. You can add links to your charts in many ways - though the most common...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue being closed is one of the many reasons I’m looking for a better visualization library - bad repo admins are bad for the community.
This issue was closed for “cleanup” - it’s the only issue (at least that hasn’t been deleted) about this much needed feature - and it’s closed: for an arbitrary, unexplained reason.
This issue was closed since I was under the impression kwent had given a solution to rafaeljneves question.
Chartkick.js itself doesn’t provide any functionality for click events, but you can use the
library
option to pass any custom options, as well as the API to get the underlying chart object and call any functions on it.