Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Line chart using org.apache.poi.ss.usermodel.charts

 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am running the example given at https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java,

it generates line chart with data given


here i came to know how values are coming for x axis but values on Y axis i did not get any clue . can some one try this?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here i came to know how values are coming for x axis but values on Y axis i did not get any clue .

What do you mean by that? What were you expecting, and what happened instead? I'd have expected "data.addSerie(xs, ys1)" and "data.addSerie(xs, ys2)" to add line lines to the chart; not so?
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the output excel file i am seeing this data

0 1 2 3 4 5 6 7 8 9
0 2 4 6 8 10 12 14 16 18
0 3 6 9 12 15 18 21 24 27

first row becomes your X axis and what about Y axis ? i got that answer
when i tried creating line chart manually in excel it calculates Y Axis values automatically based on data ranges ...

it would be great if come to know purpose of each method method like
what is legend . i went through the documentation but i did not understand that .. and what if i want to add data labels on lines created on chart
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK, there is no documentation for the chart parts of POI; javadocs and source code is all there is.

At least they put up some example code at http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/ (where your code is from) - very useful!
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow great thanks buddy ....this will help me a lot
i got apidocs here

http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFDrawing.html
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI , I copied LineChart examples from the link you provided
i am using POI 3.9 which is not having LineChart.java

which jar is containing these classes
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LineChart is example code, just like ScatterChart, and not part of POI. You need to compile it like any other code.
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not understand you .

I was getting comilation issue for that example with POI 3.9 jar
i downloaded POI jar 3.10 which resolved my issues .....
BTW here heavy rain is expected ..dark clouds coming up...nice weather to drink Tea and Pakoda ..ummmiiiiess
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic