Welcome Guest Search | Active Topics |

How to align text in the shared type tooltips?
lung12
#1 Posted : Monday, May 20, 2013 8:13:19 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/16/2012(UTC)
Posts: 15

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
How to align text in the shared type tooltips?
left | right | center?
Dragan
#2 Posted : Friday, May 24, 2013 9:10:41 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Currently you can do this with the 'tooltipFormat' event. If you look at this sample:

http://www.jqchart.com/jquery/chart/

You can change the 'tooltipFormat' event handler to:

Code:
$('#jqChart').bind('tooltipFormat', function (e, data) {

                var date = data[0].chart.stringFormat(data[0].x, "ddd, mmm dS, yyyy");

                var tooltip = '<div style="text-align:center"><b>' + date + '</b></br>' +
                      '<span style="color:' + data[0].series.fillStyle + '">' + data[0].series.title + ': </span>' +
                      '<b>' + data[0].y + '</b></br>' +
                      '<span style="color:' + data[1].series.fillStyle + '">' + data[1].series.title + ': </span>' +
                      '<b>' + data[1].y + '</b></br></div>';

                return tooltip;
            });
Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.060 seconds.