0

I have created a csv file,

and display data from database into that file,

how can I add a pie chart to that file,

this is the code which I made:

File file = new File("C:/Users/MY TOSHIBA/Desktop/chart.CSV");
Writer output =null;
output = new BufferedWriter(new FileWriter(file));

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@ 127.0.0.1:1521:XE","username","password");
String sql="select * from mawarid";

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while(rs.next())
{
 String teller =rs.getString("name");
 String flag=rs.getString("flag");
output.write(teller+flag+"\n");


 }
output.close();
2
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by sofien.fkih
0

csv is a text file format. What kind of pie chart do you want to add to a text file?
If you want a proper graphic pie chart then you will have to use a more capable file format, eg pdf.

0

It is possible to do a pie chart manually in a csv or an excel file, I am asking if there's a way to do it using java.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.