Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cant load spark lines (API issue)
26th August, 19:12
Post: #1
cant load spark lines (API issue)
Hi,

I am trying to display a sparkline graph (http://omnipotent.net/jquery.sparkline/) in a qTip.

It is stated in the Sparkline doc that if you want to display a graph in a hidden element, you have to execute

$.sparkline_display_visible()

every time the chart needs to be displayed.

So, if I have something like this:

$('#node_0001 span.voice_cost img').qtip(
{
content: 'content and sparkline data goes here',
position: {
corner: {
tooltip: 'bottomLeft',
target: 'topRight'
}},
show: {delay:1,when:{event: 'click'}},
hide: {when:{event: 'unfocus'}},
style:{tip: true, name: 'cream', width: 400}
}
);

How can I use the API to add the Sparkline method to display the charts? Nothing I tried worked. I tried:

var x = $('#node_0001 span.voice_cost img').qtip('api');
x.beforeShow(function(){alert('IT WORKS!')});

but it did not work. The alert went off without me doing anything with the qTip. I tried other events with the same result.

What am I doing wrong? Thx!
Find all posts by this user
Quote this message in a reply
26th August, 21:06
Post: #2
RE: cant load spark lines (API issue)
Alain, stick the sparkline code inside the onRender callback:

JS Code
$('.selector').qtip({
   api: {
      onRender: function () {
         $('.selector', this.elements.content).sparkLine()
      }
   }
})

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
27th August, 13:30
Post: #3
RE: cant load spark lines (API issue)
Thanks, but it did not fix my issue. I have the callback working fine (I tested with some alert), the issue seems to be with the sparkline code so I will look there.

Thx.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Qtips with jquery UI Issue sherwoodbear79 2 448 15th February 15:36
Last Post: sherwoodbear79
  [Solved] IE issue with tip arrows zero22zero 4 559 14th November 23:21
Last Post: zero22zero
  IE9 Gradient Jtools Issue howardirizarry 1 688 11th October 12:50
Last Post: Craig
  [Solved] Qtip and Lazy Load Plugin [Solved] usman 3 1,034 9th August 17:31
Last Post: Craig
  [Solved] Loading qtip on page load daysleeper 2 941 15th June 01:46
Last Post: daysleeper
  Trying to load Dynamic Content using qTip v1 sman1 1 990 6th June 11:38
Last Post: Craig
  Show api function not working occulens 1 692 27th May 17:10
Last Post: Craig
  slow to load cman 2 555 22nd March 19:50
Last Post: cman
  dynamically load clock using ajax in qtip ramzyo5 3 1,504 9th February 16:54
Last Post: Craig
  [Solved] Missing something with getting my Tooltip to Load ansible 3 780 3rd February 20:54
Last Post: ansible



User(s) browsing this thread: 1 Guest(s)