我正在做React本地项目,我们正在使用融合图表来显示不同的图形。但是,在这些图表,而用户点击的情节(图线)我们显示工具提示.
但是,我们必须像下面的截图显示工具提示.
注意:文本将是动态的
的数据
在工具提示属性中,我们只找到bgColor,bordercolor等,我们没有找到任何bgImage或为bg设置两个颜色。所以,我们尝试像设置图像在工具文本,但,仍然得到问题.
我们不能在图像上设置文本,它在图像的底部。
{
"label": "Mickey",
"value": "92",
"toolText": "<div class='container'><img height='50' width='50' position:relative text-align: center color: white alt='' src='http://www.pngpix.com/wp-content/uploads/2016/10/PNGPIX-COM-Mickey-Mouse-PNG-Transparent-Image-1-500x575.png'></img><div class='top-left'>Top Left</div></div>"
}
字符串
输出如下。
的
对此有何建议?
2条答案
按热度按时间ao218c7q1#
FusionCharts工具提示不支持在工具提示中设置多个背景色。
此外,工具提示不能设置为背景图像,或者作为一种变通方法,您可以设置一个“toolText”属性。并在div中设置您的图像,如下所示:
“toolText”:“http://www.pngpix.com/wp-content/uploads/2016/10/PNGPIX-COM-Mickey-Mouse-PNG-Transparent-Image-1-500x575.png ' style=' opacity:0.5;'>
要设置文本和图像,需要使用“toolText”属性中的标签来实现:
“toolText”:“http://www.pngpix.com/wp-content/uploads/2016/10/PNGPIX-COM-Mickey-Mouse-PNG-Transparent-Image-1-500x575.png ' style=' opacity:0.5;'>居中”
ws51t4hk2#
您可以尝试这种方式,希望它能帮助您,请参考演示fiddle
字符串
});
参考文档-https://www.fusioncharts.com/features/tooltips