Plotting using a Java applet

I have a problem when I need to draw a graph on an applet using some data in an excel file. I will need to create an applet where I can display the graph and data on one applet.

I had to write Java code to encode CSVreader and ExcelReader files. Now, I'm really stuck on how to take this data and draw it on an applet.

I do not know which classes / libraries to use for drawing a graph and how to scale it and draw actual points or develop the applet itself. I would appreciate it if someone could help me.

EDIT

Input Example:

mis(t) nt Vt N(t) h(t) H(t) 1 141 200,000 200,000 0.00071 0.00071 2 103 200,000 199,859 0.00052 0.00122 

Here the graph should be plotted for mis(t) vs. h(t) .

+4
source share
1 answer

Perhaps what you are looking for is an easy-to-use Chart app in Java. Answer by jFreeChart . They have many samples to get started right away.

And regarding reading CSV files to transfer data to jFreeChart use OpenCSV

Reading a CSV file is as easy as

 CSVReader rec = new CSVReader(new FileReader(filePath)); String[] recLine; while ((recLine = rec.readNext()) != null) { //Get the data from recLine } 

Let me know if you need more information.

+1
source

Source: https://habr.com/ru/post/1342506/


All Articles