I want to add a tooltip to an SVG element that I created with the renderer function. The tooltip text should be partially bold. Unfortunately the following code does not work – the word is not written bold.
var circle = renderer.circle(100, 100, 50)
.attr({
fill: 'red',
stroke: 'black',
'stroke-width': 2,
title: 'This is the partially <b>bold</b> Tooltip for the circle'
})
.add();
2
Answers
I tried the following code, but it doesn't work either.
JsFiddle: https://jsfiddle.net/martindfurrer/5m3yehu1/7/
The circle title is not specifically the Highcharts thing, but just svg tag, and I’m not sure if it possible to bold it
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title ;
When it comes to the second approach – the
circle
you’ve created using the renderer does not have a built-in tooltip property like data points in a series. You will need to create a custom tooltip:Demo:
https://jsfiddle.net/BlackLabel/hd01y3j7/
I’m not sure about your specific requirements, but you can also consider using a point to achieve a similar outcome:
Demo:
https://jsfiddle.net/BlackLabel/7kma8tsb/