首页 > 其他 > 详细

highcharts line鼠标hover效果

时间:2015-10-16 16:40:13      阅读:4085      评论:0      收藏:0      [点我收藏+]
$(function () {
    $(‘#container‘).highcharts({
        chart: {
            type: ‘column‘
        },
        xAxis: {
            categories: [‘Jan‘, ‘Feb‘, ‘Mar‘, ‘Apr‘, ‘May‘, ‘Jun‘, ‘Jul‘, ‘Aug‘, ‘Sep‘, ‘Oct‘, ‘Nov‘, ‘Dec‘]
        },

        plotOptions: {
            series: {
                states: {
                    hover: {
                        enabled: false
                    }
                }
            }
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
        }]
    });
});

技术分享

demo:http://jsfiddle.net/UyF9u/2/

 

var columns = [];
$.each([49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],function(i,v){
    columns.push({
        y: v,
        marker:{
            states:{
                hover:{
                    fillColor:"#ff0000",
                    backgroundColor:"#ff0000",
                    color: ‘#ff6600‘
                }
            }
        }
    });
});

$(function () {
        $(‘#container‘).highcharts({
            chart: {
                zoomType: ‘xy‘
            },
            title: {
                text: ‘Average Monthly Temperature and Rainfall in Tokyo‘
            },
            subtitle: {
                text: ‘Source: WorldClimate.com‘
            },
            tooltip: {
                shared: true
            },
            xAxis: false,
            yAxis: false,         
            legend: {
                layout: ‘vertical‘,
                align: ‘left‘,
                x: 120,
                verticalAlign: ‘top‘,
                y: 100,
                floating: true,
                backgroundColor: ‘#FFFFFF‘
            },
            series: [{
                name: ‘Rainfall‘,
                color: ‘#E5E5E5‘,
                type: ‘column‘,
                data: columns,
                tooltip: {
                    valueSuffix: ‘ mm‘
                }   
            }, {
                name: ‘Temperature‘,
                color: ‘#9B59B5‘,
                type: ‘spline‘,
                data: columns,
                tooltip: {
                    valueSuffix: ‘°C‘
                }
            }]
        });
    });
    

技术分享

demo:http://jsfiddle.net/TheSharpieOne/DMcQ3/

highcharts line鼠标hover效果

原文:http://www.cnblogs.com/sanfense/p/highcharts.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!