In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
这篇文章主要介绍如何使用DataGear制作联动异步加载图表的数据可视化看板,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
通过DataGear的参数化数据集、图表事件处理和看板API功能,可以很方便地制作联动异步加载图表的数据可视化看板。
首先,新建一个参数化SQL数据集,如下所示:
SELECT COL_NAME, --地区名 COL_VALUE, --地区指标数值FROM T_ANALYSISWHERE COL_PARENT='${上级地区名}' COL_PARENT='中国'
参数:
名称 类型 必填上级地区名 字符串 否
T_ANALYSIS表数据示例:
COL_NAME COL_VALUE COL_PARENT山东 160 中国北京 200 中国...朝阳区 195 北京海淀区 200 北京...青岛市 10 山东济南市 160 山东
然后,使用上述数据集,新建两个图表,第一个是展示全国指标的地图图表:
图表类型:基本地图数据集列标记:COL_NAME:地区名称 (name)COL_VALUE:指标数值 (value)
第二个是展示指定地区指标的柱状图:
图表类型:基本柱状图数据集列标记:COL_NAME:名称 (name) COL_VALUE:数值 (value)
然后,新建可视化看板,填写如下看板模板内容:
.dg-chart{ display: inline-block; width: 600px; height: 500px;}#loadChartWrapper{ position:absolute; top:0; left:650px; width:400px; height:300px; box-shadow: 0px 0px 6px #474747; -webkit-box-shadow: 0px 0px 6px #474747; display:none;}#loadChart{ position:absolute; top:2em; left:0; right:0; bottom:0;}function chartClickHandler(chartEvent){ //获取点击的地区名 var name = chartEvent.data.name; $("#chartTitle").html(name); var $chart = $("#loadChart"); //图表已加载,直接刷新数据 if(chartFactory.isChartElement($chart)) { var chart = dashboard.getChart("loadChart"); chart.dataSetParamValue(0, 0, name); chart.refreshData(); $("#loadChartWrapper").show(); } //图表未加载 else { dashboard.loadChart($("#loadChart"), "[第二个图表ID]",function(chart) { chart.dataSetParamValue(0, 0, name); $("#loadChartWrapper").show(); }); }}$(function(){ $("#removeChartBtn").click(function() { dashboard.removeChart("loadChart"); $("#loadChartWrapper").hide(); });}); DataGear
http://www.datagear.techDataGear 看板示例
X
点击[保存并展示]按钮,打开看板展示页面,完成!!!
注意,上述模板中的"[第一个图表ID]"、"[第二个图表ID]"要替换为实际的ID。
效果图如下所示:
以上是"如何使用DataGear制作联动异步加载图表的数据可视化看板"这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注行业资讯频道!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.