饼图:鼠标放置在饼图的分块区上显示信息 新手请指导

时间:2022-04-15 19:06:17
如在js在哪里添加鼠标放置在分块上显示信息,需要做什么修改。谢谢 
$(function () {
        var i;
        for(i=0;i<9;i++)
        {
         if(i==0)
         {
            var data = [
         { name: 'A', value: <%=East%>, color: '#4572a7' },
         { name: 'B', value: <%=West%>, color: '#aa4643' },
         { name: 'C', value: <%=South%>, color: '#89a54e' },
         { name: 'D', value: <%=North%>, color: '#80699b' }  
         ];
            var chart = new iChart.Donut2D({
                render: 'ThisYearPosition',
                data: data,
                title: {
                    text: '今年工程类别比列',
                    color: '#3e576f'
                },
              
                sub_option: {
                    label: {
                        background_color: null,
                        sign: false, //设置禁用label的小图标
                        padding: '0 4',
                        border: {
                            enable: false,
                            color: '#666666'
                        },
                        fontsize: 11,
                        fontweight: 600,
                        color: '#4572a7'
                    },
                    border: {
                        width: 2,
                        color: '#ffffff'
                    }
                },
                shadow: true,
                shadow_blur: 6,
                shadow_color: '#aaaaaa',
                shadow_offsetx: 0,
                shadow_offsety: 0,
                background_color: '#fefefe',
                offset_angle: -120, //逆时针偏移120度
                showpercent: true,
                decimalsnum: 2,
                width: 250,
                height: 100,
                radius: 120
                      });

            chart.draw();
            }

4 个解决方案

#1


去前端版块提问

#2


怎么不用图表控件呢 比写代码好用多了

#3


是啊,有专门的图表控件很漂亮的,群里都一大把的各种各样图表控件,什么都想自己干的往往什么最后都没有干好,该用别人的就用别人的,刺激消费,也给别人一些发财的机会呵呵额

#4


该回复于2013-06-04 15:22:50被管理员删除

#1


去前端版块提问

#2


怎么不用图表控件呢 比写代码好用多了

#3


是啊,有专门的图表控件很漂亮的,群里都一大把的各种各样图表控件,什么都想自己干的往往什么最后都没有干好,该用别人的就用别人的,刺激消费,也给别人一些发财的机会呵呵额

#4


该回复于2013-06-04 15:22:50被管理员删除