码迷,mamicode.com
首页 > 其他好文 > 详细

如何用图表控件实现点击图例图标隐藏图表序列

时间:2015-08-31 13:08:06      阅读:433      评论:0      收藏:0      [点我收藏+]

标签:

为了提高开发效率,第三方商用图表控件越来越被程序员广泛使用,由于第三方商用控件产品的可重用性,可以帮助企业节约GUI工程师的压力而实现灵活,绚丽的图表。

在阅读以下文章之前先下载安装试用版:


FusionCharts XT试用版下载:http://www.componentcn.com/kongjianchanpin/tubiao/jibentubiaokongjian/2014-10-30/475.html

在图表应用中,经常一个图表绘制区域内会有多个图表序列,客户为了更清晰直观地观察某一图表的变化和数据,需要对其他其他图表进行隐藏,FusionCharts XT为客户提供了该功能,当客户点击图例中某一图表的图标时,会隐藏该图表,再次点击时该图表又会出现,具体可以参考下面的部分代码:

 

{
    "chart": {
        "caption": "Comparison of Quarterly Revenue",
        "subCaption": "Last year Vs This year",
        "xAxisname": "Quarter",
        "yAxisName": "Revenue (In USD)",
        "numberPrefix": "$",
        "theme": "fint",
        "legendBgColor": "#CCCCCC",
        "legendBgAlpha": "20",
        "legendBorderColor": "#666666",
        "legendBorderThickness": "1",
        "legendBorderAlpha": "40",
        "legendShadow": "1"
    },
    "categories": [
        {
            "category": [
                {
                    "label": "Q1"
                },
                {
                    "label": "Q2"
                },
                {
                    "label": "Q3"
                },
                {
                    "label": "Q4"
                }
            ]
        }
    ],
    "dataset": [
        {
            "seriesname": "Last Year",
            "initiallyHidden": "1",//初始化时就可以隐藏该图表
            "data": [
                {
                    "value": "10000"
                },
                {
                    "value": "11500"
                },
                {
                    "value": "12500"
                },
                {
                    "value": "15000"
                }
            ]
        },
        {
            "seriesname": "This Year",
            "data": [
                {
                    "value": "25400"
                },
                {
                    "value": "29800"
                },
                {
                    "value": "21800"
                },
                {
                    "value": "26800"
                }
            ]
        }
    ]

如何用图表控件实现点击图例图标隐藏图表序列

标签:

原文地址:http://www.cnblogs.com/kjyj/p/4772704.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!