------ Solution ---------------------------------------- ----
generate charts based on data database query , and then display the chart .
can generate charts with jfreechart
eg: http://blog.csdn.net/authorzhh/article/details/6736748
can use Flex, the better , but not about the will to learn .
------ Solution ---------------------------------------- ----
recommend fusionChart, easy to use pretty
------ Solution -------------------------- ------------------
http://download.csdn.net/detail/edward4408/3455703 FusionChartsFree. could see. specialized statistical analysis Lane < br> ------ Solution ----------------------------------------- ---
FusionCharts, relatively simple, multi- graphics support
FusionChartsFree is a free version ,
------ For reference only ---------------------------- -----------
jfreechart
------ For reference only ----------------------- ----------------
jsp ..... can do it ! ! !
------ For reference only -------------------------------------- -
------ For reference only ---------------------------------- -----
are generally js or jq of
------ For reference only ---------------------- -----------------
Thank you ! I probably looked under this tool is indeed very good, but it must edit the data into XML, and then presented , there is no way to retrieve data directly from the database to XML editing it ? I tried to export the database into an XML file , but the format is different and FusionChart required , data can not be identified
------ For reference only --------------- ------------------------
Thank you ! I probably looked under this tool is indeed very good, but it must edit the data into XML, and then presented , there is no way to retrieve data directly from the database to XML editing it ? I tried to export the database into an XML file , but the format is different and FusionChart required , data can not be identified
------ For reference only --------------- ------------------------
there are 2 ways ah , you can use the XML file data , or XML file content consists of a long string of characters In other data ,
------ For reference only ----------------------------------- ----
this does not need to read from an XML inside .. in the background you can control .. the XML directly into the inside of the assignment method to action inside and then through the data inside the database value is not on line yet to get rid of .
------ For reference only ---------------------------- -----------
I understand your thinking , but do not operate, the following is a sample of the XML for FusionCharts
<?xml version="1.0" encoding="gb2312" ?>
- <graph caption="每月销售额柱形图" xAxisName="月份" yAxisName="Units" showNames="1" decimalPrecision="0" formatNumberScale="0">
<set name="一月" value="462" color="AFD8F8" />
<set name="二月" value="857" color="F6BD0F" />
<set name="三月" value="671" color="8BBA00" />
<set name="四月" value="494" color="FF8E46" />
<set name="五月" value="761" color="008E8E" />
<set name="六月" value="960" color="D64646" />
<set name="七月" value="629" color="8E468E" />
<set name="八月" value="622" color="588526" />
<set name="九月" value="376" color="B3AA00" />
<set name="十月" value="494" color="008ED6" />
<set name="十一月" value="761" color="9D080D" />
<set name="十二月" value="960" color="A186BE" />
</graph>
它所对应的html是
[code=HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body bgcolor="#FFFFFF">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="htto://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="500" id="Column3D">
<param name="movie" value="FusionCharts/FCF_Pie3D.swf"/>
<param name="FlashVars" value="&dataURL=Data.xml&charWidth=600&chartHeight=500" />
<param name="quality" value="high"/>
<embed src="FusionCharts/FCF_Pie3D.swf" flashVars="&dataURL=Data.xml&chartWidth=600&chartHeight=500" quality="high" width="600" height="500" name="Column3D" tyoe="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</object>
</body>
</html>
trouble you can give me a slightly altered look right ? Thank you, ah ~
[/ code]
------ For reference only ------------------------------ ---------
have you ever see me on top of that give you the link . ? there is not yet .. there is a JavaScript example that can be written according to the ah .
------ For reference only --------------------------------------- < br> JFreeChart looks very good. Flash that display little better .
------ For reference only -------------------------------------- -
I just give you a connection inside a folder inside JavaScript code that I have related to you send an Action inside the method .
public String GetLoansPutDetail() throws Exception{
String yeartime = super.getRequest().getParameter("yeartime");
super.getResponse().setCharacterEncoding("UTF-8");
super.getResponse().setContentType("text/xml;charset=utf-8");
Tjbbinfo pcharts = Tjbbinfo.getInstance();
pcharts.setCaption(yeartime+"经办银行小额贷款总金额分析图");
pcharts.setAnimation("0");
pcharts.setShowNames("1");
pcharts.setChartRightMargin("25");
pcharts.setBaseFont("宋体");
pcharts.setBaseFontSize("12");
pcharts.setDecimalPrecision("0");
pcharts.setBgColor("ECF2F9");
pcharts.setShowValues("1");
pcharts.setPalette("4");
pcharts.setShowToolTipShadow("0");
pcharts.setEnableSmartLabels("1");
pcharts.setEnableRotation("0");
pcharts.setFormatNumberScale("0");
List<SingleChart> list = new ArrayList<SingleChart>();
System.out.println("GetLoansPutDetail+++"+yeartime);
List<TbFinanceCreditInfo> degreeList=analysisService.findLoansInfo(yeartime);
SingleChart singleChart=null;
for (TbFinanceCreditInfo statementPojo2 : degreeList) {
singleChart=new SingleChart();
singleChart.setName(statementPojo2.getHandingbank());
singleChart.setValue(String.valueOf(statementPojo2.getLoanamount()));
singleChart.setLink("JavaScript:myJs('"+statementPojo2.getHandingbankcode()+"')");
singleChart.setColor(ColorHelper.getColor());
list.add(singleChart);
}
String strXML=pcharts.createXMLDataSingleLink(list);
System.out.println("strXML==============="+strXML);
super.getResponse().getWriter().write(strXML);
return null;
}
public String createXMLDataSingleLink(List<SingleChart> list){
StringBuffer stb = new StringBuffer();
stb.append(careateHeard());
if(list!=null){
for(SingleChart chart : list){
stb.append("<set name='"+chart.getName()+"' " +
"value='"+chart.getValue()+"' " +
"color='"+chart.getColor()+"'" +
" link=\""+chart.getLink()+"\"/>");
//+"' link='"+chart.getLink()+"'/>");
}
}
stb.append(createFoot());
System.out.println("============="+stb.toString());
return stb.toString();
}
------ For reference only ----------------------------------- ----
entity .. this kind of thing can not upload attachments. content is a little more than you want, then you can practice under me. 635403733 I can give you .
------ For reference only ---------------------------------------
main words. there is no this code it ..
<graph caption='近五年企业贷款年带动就业人数分析图' decimalPrecision='0' formatNumberScale='0' bgColor='ECF2F9' baseFontSize='12' baseFont='宋体' animation='0' chartRightMargin='25' palette='4' showToolTipShadow='0' enableSmartLabels='1' enableRotation='0'><set name='2012年' value='232' color='301B04' link="JavaScript:myJs('2012')"/><set name='2011年' value='101' color='B821E0' link="JavaScript:myJs('2011')"/></graph> jsp do not you put this spread on the line . Value in Action which can not easily change the right . ------ For reference only ------------ ---------------------------
link files that I've downloaded , I posted example is , you give way inside I needed time to digest the next , and then ask you do not understand the place , thanks ah ! !
------ For reference only -------------------------------------- -
there are examples of java web development it? that data is read from the database in a JSP page display, yes, send a copy to me , thank you very much !
E-mail : 1669852599@qq.com
没有评论:
发表评论