question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to link to an url when click on the chart ?

See original GitHub issue

Hello,

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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
mcrundocommented, Mar 15, 2019

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.

0reactions
ankanecommented, Oct 9, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found