Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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: 42972
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: 42972
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: 42972
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
  • Likes 1
  • 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
 
Gunjan Jadon
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please show me the output of this code because when I run this code , I see only a graph without X and Y axis values. please help me . Thanks in Advance!!!
 
Gunjan Jadon
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got answer of this question.
thanks
 
alina sunalina
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gunjan Jadon wrote:I got answer of this question.
thanks

Hello! I have some problems, I also see only a graph without X and Y axis values. please help me, if you have the answer.
 
Gunjan Jadon
Ranch Hand
Posts: 44
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greenhorn, Actuallly I used poi 3.15 jar file instead of poi 3.9 jar file and I used linechart
 
Gunjan Jadon
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use this
LineChartData data = chart.getChartDataFactory().createLineChartData();
                            ChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
 
alina sunalina
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gunjan Jadon wrote:Greenhorn, Actuallly I used poi 3.15 jar file instead of poi 3.9 jar file and I used linechart

Thanks! I tried to use poi 3.15 jar instead of poi 3.9.jar file and used scatterchart. Then I can see a graph with X and Y axis values.  Thank you for advance!
 
Gunjan Jadon
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your welcome
 
Gunjan Jadon
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!