SunshineCharts 仪表盘教程(最简单的flex Charts)

本文详细介绍了如何利用SunshineCharts创建仪表盘,强调了数据XML的配置,包括调试模式、图例显示、自动刷新策略等设置,并提供了HTML嵌入及JAVA代码示例,帮助读者掌握仪表盘的实现。
SunshineCharts 是一个比较简单实用的报表,它的部署教程和简单实用教程如下:

http://blog.csdn.net/arjick/article/details/6702268

这篇文章主要教大家如何实用SunshineCharts 的仪表盘。

注意:大小固定为200*250

仪表盘数据xml:

<?xml version="1.0" encoding="UTF-8"?>
<data title="123" autoRefreshPolicy="on" autoRefreshTime="180" debug="off"
	backGroudColor="0xffffff"  value="50" />


data

debug:是否开启调试模式

showDataTips:饼图是否显示快速提示

legend:是否显示图例:

autoRefreshPolicy:是否启动自动刷新

labelPosition:块石提示位置

title:标题

showAllDataTips:是否显示所有提示

clickType:点击饼图效果

backGroudColor:底色

value:仪表盘

 

HTML嵌入模式(大小固定为200*250):

html源代码

<body>
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			width="200" height="250" id="dashboardChart">
			<param name="movie" value="SunshineCharts.swf" />
			<param name="quality" value="high" />
			<param name="bgcolor" value="#ffffff" />
			<param name="allowScriptAccess" value="sameDomain" />
			<param name="allowFullScreen" value="true" />
			<param name="flashvars"
				value="type=dashboardChart&dataUrl=xml/DashboardChartXml.xml&cleanCache=off" />
			<!--[if !IE]>-->
			<object type="application/x-shockwave-flash"
				data="SunshineCharts.swf" width="200" height="250">
				<param name="quality" value="high" />
				<param name="bgcolor" value="#ffffff" />
				<param name="allowScriptAccess" value="sameDomain" />
				<param name="allowFullScreen" value="true" />
				<param name="flashvars"
					value="type=type=dashboardChart&dataUrl=xml/DashboardChartXml.xml&cleanCache=off" />
				<!--<![endif]-->
				<!--[if gte IE 6]>-->
				<p>
					Either scripts and active content are not permitted to run or Adobe
					Flash Player version 10.0.0 or greater is not installed.
				</p>
				<!--<![endif]-->
				<a href="http://www.adobe.com/go/getflashplayer"> <img
						src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
						alt="Get Adobe Flash Player" /> </a>
				<!--[if !IE]>-->
			</object>
			<!--<![endif]-->
		</object>
	</body>


Tag嵌入代码:

暂时无

 

JAVA代码:

package com.shine.framework.Charts.cofferCharts.DashboardChart;



public class DashboardChartsExample {
	public static void main(String[] args) {
		DashboardChartsHelper da=new DashboardChartsHelper();
		da.setTitle("neichun");
		da.setAutoRefreshPolicy("on");
		da.setAutoRefreshTime("180");
		da.setDebug("off");
		da.setBackGroudColor("0xffffff");
		da.setValue("80");
		System.out.println(da.getDataXml());
//		<?xml version="1.0" encoding="UTF-8"?>
//		<data title="123" autoRefreshPolicy="on" autoRefreshTime="180" debug="off"
//			backGroudColor="0xffffff"  value="50" />

	}
}
package com.shine.framework.Charts.cofferCharts.DashboardChart;

import java.util.ArrayList;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import com.shine.framework.Charts.cofferCharts.ColumnsCharts.Colunms;
import com.shine.framework.core.util.XmlUitl;

public class DashboardChartsHelper {
	private String title = "";
	private String autoRefreshPolicy = "on";
	private String autoRefreshTime = "180";
	private String debug = "off";
	private String backGroudColor = "0xffffff";
	private String value="";
	/**
	 * 输出xml数据
	 * 
	 * @return
	 */
	public String getDataXml() {
		Document document = DocumentHelper.createDocument();
		Element dataElement = document.addElement("data");
		dataElement.addAttribute("title", title);
		dataElement.addAttribute("autoRefreshPolicy", autoRefreshPolicy);
		dataElement.addAttribute("autoRefreshTime", autoRefreshTime);
		dataElement.addAttribute("debug", debug);
		dataElement.addAttribute("backGroudColor", backGroudColor);
		dataElement.addAttribute("value",value);
		return XmlUitl.doc2String(document);
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAutoRefreshPolicy() {
		return autoRefreshPolicy;
	}

	public void setAutoRefreshPolicy(String autoRefreshPolicy) {
		this.autoRefreshPolicy = autoRefreshPolicy;
	}

	public String getAutoRefreshTime() {
		return autoRefreshTime;
	}

	public void setAutoRefreshTime(String autoRefreshTime) {
		this.autoRefreshTime = autoRefreshTime;
	}

	public String getDebug() {
		return debug;
	}

	public void setDebug(String debug) {
		this.debug = debug;
	}

	public String getBackGroudColor() {
		return backGroudColor;
	}

	public void setBackGroudColor(String backGroudColor) {
		this.backGroudColor = backGroudColor;
	}
	
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}


效果图:


 

 

 

 

 

 

 

SunnyUI.Net 是基于.Net Framework 4.0+、.Net Core3.1、.Net 5 框架的 C# WinForm 开源控件库、工具类库、扩展类库、多页面开发框架。 源码编译环境:VS2019 16.8+,.Net5,.Net Core3.1 动态库应用环境:VS2010及以上,.Net Framework 4.0及以上(不包括.Net Framework 4 Client Profile),.Net Core 3.1,.Net 5.0 推荐通过Nuget安装:Install-Package SunnyUI,或者通过Nuget搜索SunnyUI安装。 软件介绍: 1、开源控件库 基于.Net Framework4.0,原生控件开发,参考 Element主题风格,包含 按钮、编辑框、下拉框、数据表格、工控仪表、统计图表在内的常用控件超过 50 个,满足常规开发需求,每个控件都精雕细琢,注重细节; 包含 Element 风格主题 11 个,其他主题 6 个,包含主题管理组件 UIStyleManager,可自由切换主题。 2、工具库 收集整理开发过程中经常用到的工具类库。 3、扩展库 收集整理开发过程中经常用到的扩展类库。 4、多页面框架 参考Element,包括7种常用框架风格,只需几行简单的代码即可创建多页面程序,其支撑组件包括UIForm,UIPage,UIFrame,集合常用控件库即可快速开发WinForm应用程序。 SunnyUI.Net开发框架 更新日志: v3.0.2 UIMarkLabel:增加带颜色标签的Label UIRoundProcess:圆形滚动条 UIBreadcrumb:增加面包屑导航 UILedLabel:增加Led标签 UIHeaderButton:在工具箱中显示 UILineChart:支持拖拽选取放大 UIDateTimePicker:修复下拉选择日期后关闭的Bug UINavMenu:增加设置二级菜单底色 UIColorPicker:增加单击事件以选中颜色 UITitlePage:增加ShowTitle可控制是否显示标题 UINavBar:增加可设置背景图片 框架增加IFrame接口,方便页面跳转 UIDataGridView:修改垂直滚动条和原版一致,并增加翻页方式滚动 UIPagination: 修正因两次查询数量相等而引起的不刷新 UIHeaderButton: 增加字体图标背景时鼠标移上背景色 UITabControl:修改第一个TabPage关不掉的Bug UIDataGridView:增加EnterAsTab属性,编辑输入时,用Enter键代替Tab键跳到下一个单元格 UILineChart:增加鼠标框选放大,可多次放大,右键点击恢复一次,双击恢复 UITitlePanel:修复OnMouseMove事件 UITrackBar:增加垂直显示方式 UIFlowLayoutPanel:修改了一处因为其加入控件大小发生变化而引起的滚动条出错。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值