Sunshinecharts is a simple and practical report. Its deployment and practical tutorials are as follows:
Http://blog.csdn.net/arjick/article/details/6702268
This article mainly teaches you how to use the column chart of sunshinecharts.
Pie chart data XML:
<? XML version = "1.0" encoding = "UTF-8"?> <Data Title = "" autorefreshpolicy = "on" autorefreshtime = "180" DEBUG = "off" backgroudcolor = "0 xffffff" verticaltitle = "price" horizontaltitle = "date" type =" clustered "showdatatips =" true "showalldatatips =" false "legend =" true "> <columns> <column value =" colunms1 "label =" Line 1 "color =" 0x00ffff "/> <column value = "colunms2" label = "1" color = "0xffff00"/> </columns> <node label = "1" colunms1 = "100" colunms2 =" 200 "/> <node label =" 2 "colunms1 =" 300 "colunms2 =" 0 "/> <node label =" 3 "colunms1 =" 100 "colunms2 =" 500" /> </data>
1. Data
Debug: whether to enable the debugging mode
Showdatatips: Indicates whether a pie chart displays a prompt.
Legend: whether to display the legend:
Autorefreshpolicy: whether to enable automatic refresh
Labelposition: indicates the position of the rock block.
Title: Title
Showalldatatips: whether to display all prompts
Clicktype: Click the pie chart.
Backgroudcolor: Background Color
2. Node
Colunms1: Column 1 Value
Colunms2: Value of Column 2
3. Column
Value: the column name mainly corresponds to the node
Label: column description
Color: The color of the column.
HTML embedding mode:
HTML source code
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"width="100%" height="100%" id="columnChart"><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=columnChart&dataUrl=xml/ColumnsChartData.xml&cleanCache=off" /><!--[if !IE]>--><object type="application/x-shockwave-flash"data="SunshineCharts.swf" width="100%" height="100%"><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=columnChart&dataUrl=xml/ColumnsChartData.xml&cleanCache=off" /><!--<![endif]--><!--[if gte IE 6]>--><p>Either scripts and active content are not permitted to run or AdobeFlash Player version 10.0.0 or greater is not installed.</p><!--<![endif]--><a href="http://www.adobe.com/go/getflashplayer"> </a><!--[if !IE]>--></object><!--<![endif]--></object>
Tag embedding code:
<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%><%@taglib uri="/WEB-INF/chartsTagLib" prefix="chart"%><%String path = request.getContextPath();String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Java code:
Package COM. shine. framework. charts. coffercharts. columnscharts; import COM. shine. framework. charts. coffercharts. linecharts. line; import COM. shine. framework. charts. coffercharts. linecharts. linechartshelper; public class columnschartsexample {/*** bar legend sub-** @ Param ARGs */public static void main (string [] ARGs) {colunms = new colunms ("colunms1", "Line 1", "0x00ffff"); colunms. put ("1", 100); colunms. put ("2", 300); colunms. put ("3", 100); colunms colunms1 = new colunms ("colunms2", "Line 1", "0xffff00"); colunms1.put ("1", 200 ); colunms1.put ("3", 500); columnschartshelper helper = new columnschartshelper (); helper. addaix ("1", "2", "3"); helper. addcolunms (colunms); helper. addcolunms (colunms1); system. out. println (helper. getdataxml ());}}
Package COM. shine. framework. charts. coffercharts. columnscharts; import Java. util. arraylist; import Java. util. list; import Org. dom4j. document; import Org. dom4j. export enthelper; import Org. dom4j. element; import COM. shine. framework. core. util. xmluitl; public class columnschartshelper {private list <colunms> columnschartslist = NULL; private list <string> aixlist = NULL; private String title = ""; private string auto Refreshpolicy = "on"; private string autorefreshtime = "180"; private string DEBUG = "off"; private string backgroudcolor = "0 xffffff"; private string verticaltitle = ""; private string horizontaltitle = ""; private string type = "clustered"; private string showdatatips = "true"; private string showalldatatips = "false"; private string legend = "true "; public columnschartshelper () {columnschartslist = new Rraylist <colunms> (); aixlist = new arraylist <string> ();} public void addcolunms (colunms) {columnschartslist. add (colunms);} public void addaix (string... AIX) {for (string S: AIx) if (! Aixlist. contains (s) aixlist. add (s);}/*** output XML data ** @ return */Public String getdataxml () {document = incluenthelper. 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 ("verticaltitle", verticaltitle); dataelement. addattribute ("horizontaltitle", horizontaltitle); dataelement. addattribute ("type", type); dataelement. addattribute ("showdatatips", showdatatips); dataelement. addattribute ("showalldatatips", showalldatatips); dataelement. addattribute ("legend", legend); element lineselement = d Ataelement. addelement ("columns"); For (colunms: columnschartslist) {element lineelement = lineselement. addelement ("column"); lineelement. addattribute ("value", colunms. getvalue (); lineelement. addattribute ("label", colunms. getlabel (); lineelement. addattribute ("color", colunms. getcolor () ;}for (string S: aixlist) {element nodeelement = dataelement. addelement ("Node"); nodeelement. addattribute (" Label ", S); For (colunms: columnschartslist) {If (colunms. Get (s )! = NULL) {nodeelement. addattribute (colunms. getvalue (), String. valueof (colunms. get (s);} else {nodeelement. addattribute (colunms. getvalue (), "0") ;}} return xmluitl.doc 2 string (document);} public void clean () {columnschartslist. clear (); aixlist. clear ();} public list <colunms> getcolumnschartslist () {return columnschartslist;} public void setcolumnschartslist (list <colunms> columnschartslist) {This. columnschartslist = columnschartslist;} public list <string> getaixlist () {return aixlist;} public void setaixlist (list <string> aixlist) {This. aixlist = aixlist;} 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 getverticaltitle () {return verticaltitle;} public void setverticaltitle (string verticaltitle) {This. verticaltitle = verticaltitle;} Public String gethorizontaltitle () {return horizontaltitle;} public void sethorizontaltitle (string horizontaltitle) {This. horizontaltitle = horizontaltitle;} Public String GetType () {return type;} public void settype (string type) {This. type = type;} Public String getshowips IPS () {return showdatatips;} public void setshowdatatips (string showdatatips) {This. showdatatips = showdatatips;} Public String getshowalldatatips () {return showalldatatips;} public void setshowalldatatips (string showalldatatips) {This. showalldatatips = showalldatatips;} Public String getlegend () {return legend;} public void setlegend (string legend) {This. legend = legend ;}}
: