带有图标的 amChart CategoryAxes
amChart CategoryAxes with icons
我想知道是否有办法将图像添加到 amChart 中的 CategoryAxes。
我找到了一个可以在每个图表中包含图像的演示,但是这些图像总是靠近图表 and/or 给定它们的偏移量,但我需要让这些图像保持在图表的顶部。
我试图给 CategoryAxes 上的类别字段一个 <img src ="">
,但它只显示文本,显示所有标签。
我阅读了这个类别可以有的方法和选项,但我没有找到任何说它可以显示图像的东西,所以,可以添加它们吗?
添加:
//Doesn't works the "category" option
"dataProvider": [
"category": "<img src='link_to_image.png'>",
"column-1": 120.99,
//other values...
"myBullet1": "<img src='link_to_image.png'>" //this with graph works, but doesn't puts it on top of the chart
],
"graphs": [
"customBulletField": "myBullet1",
"bulletOffset": 20,
"bulletSize": 34,
//other values
],
//other options
好吧,amCharts 的支持回答了我,使这个问题成为可能。这里我把jsFiddle留给以后有需要的人:
jsFiddle amCharts 演示
...
img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'http://www.amcharts.com//lib/3/images/1.gif');
在这一行中,因为它在一个 for 循环中,所以您可以在一个数组中有一组图像,然后使用一个可以使其递增的计数器,您可以将您需要的图像放在每个类别轴中。
我想知道是否有办法将图像添加到 amChart 中的 CategoryAxes。
我找到了一个可以在每个图表中包含图像的演示,但是这些图像总是靠近图表 and/or 给定它们的偏移量,但我需要让这些图像保持在图表的顶部。
我试图给 CategoryAxes 上的类别字段一个 <img src ="">
,但它只显示文本,显示所有标签。
我阅读了这个类别可以有的方法和选项,但我没有找到任何说它可以显示图像的东西,所以,可以添加它们吗?
添加:
//Doesn't works the "category" option
"dataProvider": [
"category": "<img src='link_to_image.png'>",
"column-1": 120.99,
//other values...
"myBullet1": "<img src='link_to_image.png'>" //this with graph works, but doesn't puts it on top of the chart
],
"graphs": [
"customBulletField": "myBullet1",
"bulletOffset": 20,
"bulletSize": 34,
//other values
],
//other options
好吧,amCharts 的支持回答了我,使这个问题成为可能。这里我把jsFiddle留给以后有需要的人:
jsFiddle amCharts 演示
...
img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'http://www.amcharts.com//lib/3/images/1.gif');
在这一行中,因为它在一个 for 循环中,所以您可以在一个数组中有一组图像,然后使用一个可以使其递增的计数器,您可以将您需要的图像放在每个类别轴中。