Skip to content

cutecharts/cutecharts.java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cutecharts.java logo

🎨A hand drawing style charts library in Java.

 📣 Description

  • The cute hand drawing style charts library is based on this project chart.xkcd 🚀.
  • There is an implemention in Python (cutecharts.py) from my cute friend 🐶.
  • This project is the implemention in Java (cutecharts.java) 🎨.

🔖 Documentation

All the configurations detail you can find on there chart.xkcd.
All the demos are already in the demo directory.

📝 Useage

Import Dependency

pom.xml

<dependency>
    <groupId>com.koy</groupId>
    <artifactId>cutecharts</artifactId>
    <version>1.0.0</version>
</dependency>

Code Demo

DataSet dataSet = new DataSet("Kobe", new Integer[]{5, 2, 2, 3, 1, 4});
DataSet dataSet1 = new DataSet("God", new Integer[]{1, 1, 1, 1, 1, 1});

RadarOptions radarOptions = new RadarOptions();
radarOptions.setShowLegend(true);
radarOptions.setShowLabels(true);
radarOptions.setBackgroundColor("purple");
radarOptions.setDataColors(new String[]{"#d48265", "#61a0a8"});

Chart radar = new ChartBuilder.newChart(ChartType.RADAR, "Demo-Radar")
        .setOptions(radarOptions)
        .setLabels(new String[]{"score", "assist", "rebound", "block", "steal", "shootRate"})
        .setData(dataSet)
        .setData(dataSet1)
        .build();
RenderExecutor.render(radar);

kobe

DataSet dataSet1 = new DataSet("Beer", new Integer[]{1, 2, 3, 4, 2, 5, 4});
DataSet dataSet2 = new DataSet("Juice", new Integer[]{1, 4, 7, 4, 1, 3, 2});

LineOptions lineOptions = new LineOptions();
lineOptions.setBackgroundColor("orange");
lineOptions.setLegendPosition(PositionType.UP_RIGHT);

Chart line = new ChartBuilder.newChart(ChartType.LINE, "Demo-Line")
        .setOptions(lineOptions)
        .setLabels(new Integer[]{1, 2, 3, 4, 5, 6, 7})
        .setXLabel("X-axis Week")
        .setYLabel("Y-axis Amount")
        .setData(dataSet1)
        .setData(dataSet2)
        .build();
RenderExecutor.render(line);

line

📃 License

MIT ©Koy