Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c9a915

Browse files
committed
test simple scatter
1 parentf198213 commit9c9a915

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
packageorg.icepear.echarts.simple.scatter;
2+
3+
importstaticorg.junit.Assert.assertEquals;
4+
5+
importjava.io.InputStreamReader;
6+
importjava.io.Reader;
7+
8+
importcom.google.gson.JsonElement;
9+
importcom.google.gson.JsonParser;
10+
11+
importorg.icepear.echarts.Scatter;
12+
importorg.icepear.echarts.serializer.EChartsSerializer;
13+
importorg.junit.Test;
14+
15+
publicclassBasicScatterTest {
16+
@Test
17+
publicvoidtestBasicScatter() {
18+
Scatterscatter =newScatter()
19+
.addXAxis()
20+
.addYAxis()
21+
.addSeries(newNumber[][] {
22+
{10.0,8.04 }, {8.07,6.95 }, {13.0,7.58 }, {9.05,8.81 }, {11.0,8.33 }, {14.0,7.66 },
23+
{13.4,6.81 }, {10.0,6.33 }, {14.0,8.96 }, {12.5,6.82 }, {9.15,7.2 }, {11.5,7.2 },
24+
{3.03,4.23 }, {12.2,7.83 }, {2.02,4.47 }, {1.05,3.33 }, {4.05,4.96 }, {6.03,7.24 },
25+
{12.0,6.26 }, {12.0,8.84 }, {7.08,5.82 }, {5.02,5.68 }
26+
});
27+
28+
Readerreader =newInputStreamReader(
29+
this.getClass().getResourceAsStream("/simple/scatter/basic-scatter.json"));
30+
JsonElementexpected =JsonParser.parseReader(reader);
31+
JsonElementactual =EChartsSerializer.toJsonTree(scatter.getOption());
32+
assertEquals(expected,actual);
33+
34+
// System.out.println(EChartsSerializer.toJson(scatter.getOption()));
35+
}
36+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"xAxis": [{"type":"value" }],
3+
"yAxis": [{"type":"value" }],
4+
"series": [
5+
{
6+
"type":"scatter",
7+
"data": [
8+
[10.0,8.04],
9+
[8.07,6.95],
10+
[13.0,7.58],
11+
[9.05,8.81],
12+
[11.0,8.33],
13+
[14.0,7.66],
14+
[13.4,6.81],
15+
[10.0,6.33],
16+
[14.0,8.96],
17+
[12.5,6.82],
18+
[9.15,7.2],
19+
[11.5,7.2],
20+
[3.03,4.23],
21+
[12.2,7.83],
22+
[2.02,4.47],
23+
[1.05,3.33],
24+
[4.05,4.96],
25+
[6.03,7.24],
26+
[12.0,6.26],
27+
[12.0,8.84],
28+
[7.08,5.82],
29+
[5.02,5.68]
30+
]
31+
}
32+
]
33+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp