Solution 1 :

I did more or less the same thing years ago.

Look at plotly JS, with just a simple js file which load all your JSONs you can do all, maybe just change a bit your JSON to fit in Plotly expectations without too much effort.

Just look at examples and which js you need to add to your html.

Problem :

I am running a simple Java class that generates a bunch of data and stores them in JSON. Now I want to visualize these data using charts and graphs. How to do that in Java? All I want is to create a method from the Java class which will create an HTML file with different charts in it. The method will be fed with the test data. Below is the skeleton of my program:

public class DataGenerator {

    public static void main(String[] args) {
        JsonData data = runTest();
        createReportWithChart(data);
    }

    JsonData runTest() {
        //executes tests and returns testData in JSON format
    }

    void createReportWithChart(JsonData data) {
        //creates an HTML with different charts and graphs
    }
}

How do I achieve this?

By

Leave a Reply

Your email address will not be published. Required fields are marked *