Skip to content

Commit 053ea07

Browse files
committed
[update] write README and adjust Demo.
1 parent 24a1388 commit 053ea07

2 files changed

Lines changed: 79 additions & 11 deletions

File tree

README.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,71 @@
1-
# cutecharts-fun.java
2-
:paint: A handle style Chart lib in Java (funtional).
1+
<p align="center">
2+
<img src="https://user-images.githubusercontent.com/19553554/66697551-27384b00-ed09-11e9-9fe8-210918fdeb77.png" alt="cutecharts.java logo" width=600/>
3+
</p>
4+
5+
<p align=center>
6+
<i>🎨A hand drawing style charts library in functional Java.</i>
7+
</p>
8+
9+
##  📣 Description
10+
11+
This is a `functional` version of [cutecharts.java](https://github.com/cutecharts/cutecharts.java) which I want try to write `Java` on `non-Java`. :dog:
12+
13+
Definitely, It is more fun to make something has more possibilities.
14+
15+
16+
## 🔖 Documentation
17+
18+
> All the configurations detail you can find on there [chart.xkcd](https://timqian.com/chart.xkcd/).
19+
20+
<img src=https://user-images.githubusercontent.com/33706142/77919719-1e93fb00-72d0-11ea-8116-e2aa4a89d64a.png />
21+
22+
## 📝 Useage
23+
24+
> Using the `Functional` stuff, it should be `JDK8` at least.
25+
26+
### Import Dependency
27+
> Maven
28+
```xml
29+
<dependency>
30+
<groupId>com.koy</groupId>
31+
<artifactId>cutecharts-func</artifactId>
32+
<version>1.0.0</version>
33+
</dependency>
34+
```
35+
36+
> Gradle
37+
38+
```shell
39+
compile group: 'com.koy', name: 'cutecharts-func', version: '1.0.0'
40+
```
41+
42+
43+
44+
### Code Demo
45+
46+
```java
47+
Chart line = Chart.newChart(ChartType.LINE)
48+
.setGlobalOptions(
49+
GlobalOptions.setTitle("Demo-Line"),
50+
GlobalOptions.setXLabel("X-axis Week"),
51+
GlobalOptions.setYLabel("Y-axis Amount")
52+
).setSeriesOptions(
53+
SeriesOptions.setBackgroundColor("orange")
54+
)
55+
.setDataLabels(1, 2, 3, 4, 5, 6, 7)
56+
.setDataSeriesOptions(
57+
DataSet.addDataSet("Beer", 1, 2, 3, 4, 2, 5, 4),
58+
DataSet.addDataSet("Juice", 1, 4, 7, 4, 1, 3, 2)
59+
)
60+
.build();
61+
62+
RenderExecutor.renderToPath("./").accept(line);
63+
```
64+
65+
![line](https://user-images.githubusercontent.com/33706142/77851369-69980a80-720b-11ea-885b-a39fc54d83d9.png)
66+
67+
68+
## 📃 License
69+
70+
MIT [©Koy](https://github.com/Koooooo-7)
71+

src/main/java/Demo.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@
1313

1414
public class Demo {
1515
public static void main(String[] args) {
16-
Chart line = Chart.newChart(ChartType.STACKED_BAR)
16+
Chart line = Chart.newChart(ChartType.LINE)
1717
.setGlobalOptions(
18-
GlobalOptions.setTitle("Demo"),
19-
GlobalOptions.setXLabel("x"),
20-
GlobalOptions.setYLabel("y")
18+
GlobalOptions.setTitle("Demo-Line"),
19+
GlobalOptions.setXLabel("X-axis Week"),
20+
GlobalOptions.setYLabel("Y-axis Amount")
2121
).setSeriesOptions(
22-
SeriesOptions.setBackgroundColor("yellow")
22+
SeriesOptions.setBackgroundColor("orange")
2323
)
24-
.setDataLabels("Mon", "Tue", "Wed", "Thu")
24+
.setDataLabels(1, 2, 3, 4, 5, 6, 7)
2525
.setDataSeriesOptions(
26-
DataSet.addDataSet("apple", 1, 2, 3, 4),
27-
DataSet.addDataSet("banana", 11, 2, 6, 4),
28-
DataSet.addDataSet("peal", 3, 6, 2, 7)
26+
DataSet.addDataSet("Beer", 1, 2, 3, 4, 2, 5, 4),
27+
DataSet.addDataSet("Juice", 1, 4, 7, 4, 1, 3, 2)
2928
)
3029
.build();
3130

0 commit comments

Comments
 (0)