admin管理员组文章数量:1434922
Hi I was wondering how to make the title in highcharts a link so that it would work with bootstrap's popover functionality. Here is a fiddle
/
$(function () {
$('#container').highcharts({
chart: {},
title: {
text: 'Sales Funnel ' + '<a style="font-size:12px" id="popoverFunnel" data-toggle="popover" title="hello" data-content="hellooo">Hello</a>'
},
xAxis: {
minPadding: 0.05,
maxPadding: 0.05
},
series: [{
data: [{
x: 0,
y: 29.9,
url: ''
}, {
x: 1,
y: 71.5,
url: ''
}]
}],
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
var url = this.options.url;
window.open(url);
}
}
},
}
},
});
});
$('document').ready(function () {
$('#popoverFunnel').popover();
});
Thank you James
Hi I was wondering how to make the title in highcharts a link so that it would work with bootstrap's popover functionality. Here is a fiddle
http://jsfiddle/287JP/4/
$(function () {
$('#container').highcharts({
chart: {},
title: {
text: 'Sales Funnel ' + '<a style="font-size:12px" id="popoverFunnel" data-toggle="popover" title="hello" data-content="hellooo">Hello</a>'
},
xAxis: {
minPadding: 0.05,
maxPadding: 0.05
},
series: [{
data: [{
x: 0,
y: 29.9,
url: 'http://www.google.'
}, {
x: 1,
y: 71.5,
url: 'http://www.yahoo.'
}]
}],
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
var url = this.options.url;
window.open(url);
}
}
},
}
},
});
});
$('document').ready(function () {
$('#popoverFunnel').popover();
});
Thank you James
Share Improve this question edited Apr 1, 2014 at 22:12 James asked Apr 1, 2014 at 22:05 JamesJames 5571 gold badge12 silver badges31 bronze badges2 Answers
Reset to default 4Set title.useHTML = true
, see: http://jsfiddle/287JP/5/
$('#container').highcharts({
title: {
useHTML: true,
text: 'Sales Funnel ' + '<a style="font-size:12px" id="popoverFunnel" data-toggle="popover" title="hello" data-content="hellooo">Hello</a>'
},
...
});
I took your example and made it work with Bootstrap. See http://jsfiddle/key2xanadu/zfsfz0c9/.
The solution involves ID tagging the puppies and then tooltipping them at the bottom:
$('document').ready(function () {
$("#text_title").tooltip({placement: 'bottom', title:"HELLO TITLE!"});
$("#label_one").tooltip({placement: 'bottom', title:"HELLO ONE!"});
$("#label_two").tooltip({placement: 'bottom', title:"HELLO TWO!"});
});
Example also shows how to add tooltips to the x-axis labels!
本文标签: javascriptmaking title in highcharts clickable and work with bootstrap popoverStack Overflow
版权声明:本文标题:javascript - making title in highcharts clickable and work with bootstrap popover? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745616418a2666428.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论