Permalink
Browse files

更新版本2.2.6

  • Loading branch information...
abel533 committed Jul 16, 2015
1 parent caf719f commit 17f35c87ae38ff6e430a435213337d4ae609b006
Showing with 96 additions and 5 deletions.
  1. +1 −1 LICENSE
  2. +9 −2 README.md
  3. +2 −2 pom.xml
  4. +84 −0 src/test/java/com/github/abel533/echarts/samples/heatmap/HeatmapTest.java
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014 abel533@gmail.com
Copyright (c) 2014-2015 abel533@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
#ECharts - Java类库
**当前版本2.2.4**
**当前版本2.2.6**
本项目是一个供Java开发使用的ECharts的开发包,主要目的是方便在Java中构造ECharts中可能用到的全部数据结构,如完整的结构Option。Option中的数据Series,包含Bar-柱状图,Line-折线图,Pie-饼图,Chord-和弦图等,支持ECharts中的所有图表。支持所有的Style类,如AreaStyle,ChordStyle,ItemStyle,LineStyle,LinkStyle等等。支持多种Data数据类型,一个通用的Data数据,以及PieData,MapData,ScatterData,KData等针对性的数据结构。
@@ -24,7 +24,7 @@
[ECharts-x.x.x.jar](http://mvnrepository.com/artifact/com.github.abel533/ECharts)
[API文档-2.2.4](https://oss.sonatype.org/content/repositories/releases/com/github/abel533/ECharts/2.2.4/ECharts-2.2.4-javadoc.jar) 下载后解压即可
[API文档-2.2.6](https://oss.sonatype.org/content/repositories/releases/com/github/abel533/ECharts/2.2.6/ECharts-2.2.6-javadoc.jar) 下载后解压即可
##项目支持
###图表类型
@@ -46,6 +46,7 @@
- Tree - 树图
- Treemap - 矩形树图
- WordCloud - 词云
- Heatmap - 热力图
###ECharts组件
@@ -61,6 +62,12 @@
##更新日志
###2.2.6
- 由于echarts.js-2.2.5版本只是修复bug,对本项目没有影响,可以直接用echarts-java-2.2.4,所以跳过2.2.5版本
- echarts.js-2.2.6新增Option 查找工具,本项目已经完全和这个工具对照过,已经补充部分缺少的属性
- 新增热力图`heatmap`,对应测试代码[HeatmapTest](http://git.oschina.net/free/ECharts/blob/master/src/test/java/com/github/abel533/echarts/samples/heatmap/HeatmapTest.java)(如果看不到效果,那就是因为测试中的引用的echarts-all.js还不是2.2.6版本,自己替换就行)
###2.2.4
- `TreeMap`增加`root`
@@ -22,13 +22,13 @@
~ THE SOFTWARE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.abel533</groupId>
<artifactId>ECharts</artifactId>
<version>2.2.4</version>
<version>2.2.6</version>
<packaging>jar</packaging>
<name>ECharts</name>
@@ -0,0 +1,84 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 abel533@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.github.abel533.echarts.samples.heatmap;
import com.github.abel533.echarts.data.GradientColor;
import com.github.abel533.echarts.series.Heatmap;
import com.github.abel533.echarts.util.EnhancedOption;
import org.junit.Test;
import java.util.LinkedList;
import java.util.List;
/**
* @author liuzh
*/
public class HeatmapTest {
public List<Object[]> headData() {
List<Object[]> list = new LinkedList<Object[]>();
for (int i = 0; i < 20; ++i) {
list.add(new Object[]{
400 + Math.random() * 300,
5 + Math.random() * 10,
Math.random()
});
}
for (int i = 0; i < 100; ++i) {
list.add(new Object[]{
100 + Math.random() * 600,
150 + Math.random() * 50,
Math.random()
});
}
for (int i = 0; i < 200; ++i) {
list.add(new Object[]{
400 + Math.random() * 1000,
5 + Math.random() * 800,
Math.random() * 0.5
});
}
return list;
}
@Test
public void test() {
//地址:http://echarts.baidu.com/doc/example/heatmap.html
EnhancedOption option = new EnhancedOption();
option.title().text("热力图自定义样式");
Heatmap heatmap = new Heatmap();
heatmap.data(headData().toArray());
heatmap.hoverable(false)
.gradientColors(
new GradientColor(0.4, "green"),
new GradientColor(0.5, "yellow"),
new GradientColor(0.8, "orange"),
new GradientColor(1d, "red"));
heatmap.minAlpha(0.2).valueScale(2d).opacity(0.6);
option.series(heatmap);
option.exportToHtml("heatmap.html");
option.view();
}
}

0 comments on commit 17f35c8

Please sign in to comment.