如何为amCharts指南添加鼠标?

时间:2014-12-17 16:39:45

标签: javascript amcharts

在amCharts Area Chart中,是否可以为类似下方的指南添加气球?要求是在用户将鼠标悬停在垂直线上时显示有关垂直线的更多信息。

enter image description here

1 个答案:

答案 0 :(得分:1)

是的,你可以。你应该将balloonText添加到指南对象,不像你那样,但是像这样:

        "guides": [{
        category: "2001",
        toCategory: "2003",
        lineColor: "#CC0000",
        lineAlpha: 1,
        fillAlpha: 0.2,
        fillColor: "#CC0000",
        dashLength: 2,
        inside: true,
        labelRotation: 90,
        label: "fines for speeding increased",
        "balloonText": "<img src='http://www.amcharts.com/lib/3/images/car.png' style='vertical-align:bottom; margin-right: 10px; width:28px; height:21px;'><span style='font-size:14px; color:#000000;'><b>asaassssss</b></span>",
    }, {
        category: "2007",
        lineColor: "#CC0000",
        lineAlpha: 1,
        dashLength: 2,
        inside: true,
        labelRotation: 90,
        label: "motorcycle fee introduced"
    }]      

http://jsfiddle.net/5pdunxqf/2/