一个实现画板的程序(与我的项目没啥关系)
发现一个实现图表的js程序
chartjs官网,我一会儿得学学
echarts的js的实例,唉,找不到一个好的方法
看了看echarts的官方文档,发现echarts确实非常强悍相比如chartjs来说,针对我的项目可能对于数据可视化有着较强的依赖,所以权衡之下我准备重新学习百度echarts的文档将我项目中的数据进行可视化
echarts的一个java例子https://blog.csdn.net/qq_43251032/article/details/89673845
echart的安装
https://www.runoob.com/echarts/echarts-install.html
将Map转为JSON
import java.util.HashMap;
import java.util.Map;
import net.sf.json.JSONObject;
public class aaa {
public static void main(String[] args) {
Map map = new HashMap();
map.put("msg", "yes");//map里面装有yes
JSONObject jsonObject = JSONObject.fromObject(map);
System.out.println("输出的结果是:" + jsonObject);
//3、将json对象转化为json字符串
String result = jsonObject.toString();
System.out.println(result);
}
}
将map转JSON的方法
https://blog.csdn.net/hui008/article/details/81180747
异步加载数据
https://echarts.apache.org/zh/tutorial.html#%E5%BC%82%E6%AD%A5%E6%95%B0%E6%8D%AE%E5%8A%A0%E8%BD%BD%E5%92%8C%E6%9B%B4%E6%96%B0
让折线显示具体的值
itemStyle : { normal: {label : {show: true}}}
字符串数组逆序的方法
public void arrayReverse3() {
int temp = 0;
for (int i = 0; i < length / 2; i++) {
temp = originArray[i];
originArray[i] = originArray[length - i - 1];
originArray[length - i - 1] = temp;
}
}