echart使用例子
来源:互联网 发布:怎么避免mac涂层脱落 编辑:程序博客网 时间:2024/06/06 04:39
先看看工程目录,将百度的工程文件复制到自己的工程里面,这里不再赘述。
然后根据需要选取echart图表 示例地址
新建一个Servelet,jsp文件使用Ajax.
package com.lv.controller;import java.io.IOException;import java.io.PrintWriter;import java.util.LinkedHashMap;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import net.sf.json.JSONArray;public class EchartsServlet extends HttpServlet {private static final long serialVersionUID = 1L;/** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {this.doPost(request, response);}/** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {//设置返回值的编码格式//这个是可以直接使用网页访问URL,然后返回值也不会出现中文乱码 所以(1)比二好response.setContentType("text/html; charset=utf-8");//(1)//response.setCharacterEncoding("utf-8"); //(2)两者选其一LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();map.put("text","人物关系:自定义");map.put("subtext","数据仅用于测试");//调用JSONArray.fromObject方法把map中的对象转化为JSON格式的数组JSONArray json=JSONArray.fromObject(map);System.out.println(json.toString());//返回给前段页面PrintWriter out = response.getWriter(); out.println(json);out.flush(); out.close(); }}
0 0
- echart使用例子
- echart使用
- Echart使用
- echart 使用
- echart使用经验
- echart的使用记录
- echart 使用jsp展示
- echart基本使用
- Echart 关系图使用
- 百度echart 使用示例
- EChart tooltip formatter使用
- yii2使用echart饼图
- 关于echart的一个小例子
- echart
- Echart
- echart
- EChart
- Echart
- js-refferrer无法显示前个页面的地址的解决方法
- 正确理解MySQL中列索引和多列索引
- 大杀器-RoboBinding
- Java-----11、JDBC编程
- scv.lua 的使用
- echart使用例子
- 测试题--by 罗雨屏
- Android-LinearGradient实现TextView字体渐变的效果
- windows 路由表
- 设计模式读书笔记-----访问者模式
- hibernate+spring架构有感
- 取剪贴板内容
- 数据结构整理_有序顺序表合并
- <img>元素底部留有空白