Making clickable links along x-axis

477 views
Skip to first unread message

allent...@gmail.com

unread,
Jul 23, 2013, 11:56:21 AM7/23/13
to flot-...@googlegroups.com
I've searched far and wide on this issue and have come up empty-handed. Is there an existing plugin for making x-axis ticks into clickable links? I understand how to make items along a bar graph clickable. I've also edited the ticks to display names along the x-axis. However, I also want to be able to click on the x-axis ticks and access a given URL.
 
I've noticed that any clicks outside the graphable area will produce pos.x and pos.y values, but cannot be associated with a specific item, and therefore can't be associated with a specific dataIndex.
 
Are there any existing plugins which deal with this issue?
 
 
 
 
 

Juergen Marsch

unread,
Jul 24, 2013, 7:46:01 AM7/24/13
to flot-...@googlegroups.com
Hello, you can try this after creating the chart

    $(".flot-tick-label").css("zIndex","2");
    $(".flot-tick-label").click(function(a){ alert("tick-label " + $(this).text() + " clicked");});

To get xaxis only, use this

$(".flot-x-axis .flot-tick-label").click(function(){.....

Regards from Krefeld(Germany, cloudy and about 24 degrees Celsius)
Juergen



 
 
 
 
 

--
 
---
You received this message because you are subscribed to the Google Groups "Flot graphs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flot-graphs...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

allent...@gmail.com

unread,
Jul 24, 2013, 4:37:32 PM7/24/13
to flot-...@googlegroups.com, juerge...@googlemail.com
Wow, thank you so much. This works perfectly. I wasn't aware of the flot-tick-label events.
 
Thank you again!
 
 
 
Allen
Reply all
Reply to author
Forward
0 new messages