FusionCharts 생 성 보고서 응용
4576 단어 보고서JavaScriptJSPXMLFusionCharts
1.전시 할 데 이 터 를 조립 해 야 합 니 다.데이터 모델 을 어떻게 디자인 하 는 지 보 여 주 려 는 도형 과 필요 한 데 이 터 를 보면 됩 니 다.간단 한 걸 로.
실체 류 는 두 개의 속성 만 있 고 Bean 안의 실체 류 도 사용 할 수 있 습 니 다.괜 찮 습 니 다.
package com.golden.entity;
public class Doughnut {
public Doughnut() {
}
private String label;
private int value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public Doughnut(String label, int value) {
super();
this.label = label;
this.value = value;
}
}
2.Servlet 에 요청 을 하고 간단하게 사용 할 수도 있 고 Action 에 요청 할 수도 있 습 니 다.괜 찮 습 니 다.이 Servlet 는 나중에 데 이 터 를 얻어 요청 환경 에 설정 합 니 다.
package com.golden.servlet;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.golden.entity.Doughnut;
@SuppressWarnings("serial")
public class FirstServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
List list = new ArrayList();
Doughnut d1 = new Doughnut("France", 17);
Doughnut d2 = new Doughnut("India", 12);
Doughnut d3 = new Doughnut("Brazil", 18);
Doughnut d4 = new Doughnut("USA", 8);
Doughnut d5 = new Doughnut("Australia", 10);
Doughnut d6 = new Doughnut("Japan", 7);
Doughnut d7 = new Doughnut("England", 5);
Doughnut d8 = new Doughnut("Nigeria", 12);
Doughnut d9 = new Doughnut("Italy", 8);
Doughnut d10 = new Doughnut("China", 10);
Doughnut d11 = new Doughnut("Canada", 19);
Doughnut d12 = new Doughnut("Germany", 15);
list.add(d1);
list.add(d2);
list.add(d3);
list.add(d4);
list.add(d5);
list.add(d6);
list.add(d7);
list.add(d8);
list.add(d9);
list.add(d10);
list.add(d11);
list.add(d12);
request.getSession().setAttribute("list", list);
request.getRequestDispatcher("/show.jsp").forward(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
3.설정,예 를 들 어 필요 한 Swf 파일 과 JS 파일 은 JSTL 이 필요 하기 때문에 가방 을 도입 하고 페이지 에 라벨 을 도입 하 며 저급한 작업 을 빨리 해결 해 야 합 니 다.
4.페이지 를 불 러 올 때 데이터 가 XML 파일 을 만 드 는 문자열 을 초기 화하 고 SWF 에 설정 하면 데 이 터 를 표시 하고 해결 합 니 다.
FusionCharts
var majorXml;
//var list;
function init(){
initXml();
}
function initXml(){
majorXml="<chart palette='2' showBorder='1'>";
majorXml += "<c:forEach var ='item' items='${list}'><set label='${item.label}' value='${item.value}'/></c:forEach>";
majorXml+="</chart>";
showDou3D();
}
function showDou3D(){
var myChart=new FusionCharts("<%=request.getContextPath()%>/FusionCharts/Doughnut3D.swf", "ChartId", "600", "300", "0", "0");
myChart.setDataXML(majorXml);
myChart.render("majorbus");
}
5.파일 이 어디 에 있 는 지 모 르 겠 습 니 다.Webroot 에 js 와 Fusion Charts 폴 더 를 만 들 고 각각 근처에 넣 습 니 다.JSTL 이 없 는 LIB 에 있 습 니 다.
다운로드 횟수:495
다운로드 횟수:556
다운로드 횟수:797
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Google Analytics 보고서를 정기적으로 이메일로 보내는 설정우선은 정기적으로 전달하는 리포트를 작성한다. 어느 사이트에서도 사용할 수 있는 범용적인 마이 리포트를 작성해 두면 즐거움. 보고서 화면에서 '공유'에서 '템플릿 링크 공유'를 선택하면 URL이 표시되므로 그것을 복...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.