Hitachi Vantara Pentaho Community Forums
Results 1 to 11 of 11

Thread: Howto create a pie chart?

  1. #1
    Join Date
    Apr 2006
    Posts
    3

    Default Howto create a pie chart?

    Hi,

    at the moment, i evaluate the pentaho BI and it is very easy to create a (table) report with the design wizard or iReport.
    But now i wanna create a pie chart. Because there is no way with the design wizard, first i tried it with iReport 1.2.0 and it works fine. After i insert the report in pentaho, i got a error message "can't compile". Then i changed the jasperreports-1.0.0.jar library in pentaho-demo\\jboss\\server\\default\\deploy\\pentaho.war\\WEB-INF\\lib to jasperreports-1.2.0.jar and now pentaho can compile the jasper file. But i can't see the pie chart and on the command line i got the following error message (the message was in german and i try to translate them):

    16:24:30,640 ERROR [JasperReportsComponent] 36ad4626-cfb0-11da-a6d4-a9e8b7396ec6
    :COMPONENT:context-4404924-1145456669937:jasperReport.xaction [de_103] JasperReport.ERROR_0014 - [de_69] Report execution failed java.io.FileNotFoundException: C:\\Pentaho\\pentaho-demo\\pentaho-solutions\\getImag
    e?image=\\ersterChart\\img_0_2_0 (the Syntax for the filename, directory or the volumelabel is wrong)

    What is the problem? Did anybody have a hint for me?

    Then i try to generate the pie chart directly in pentaho workbench, how it is descibe in the Pentaho_Creating_Solutions_1.1.4.pdf guide. This works. I got the message on the screen:

    [de_121] Action Successful
    --------------------------------------------------------------------------------

    rule-result=tmp_chart_54193.png

    and the png file was created in the directory C:\\Pentaho\\pentaho-demo\\pentaho-solutions\\system\\tmp

    How can i display it on the screen?

    All hints will be welcome

    Best regards

    Holger Koch http://forums.pentaho.org/archived_a...tChart.xaction

  2. #2
    Join Date
    Jan 2006
    Posts
    460

    Default Re:Howto create a pie chart?

    Holger-

    Have you tried looking at our PieChart sample? It is under http://localhost:8080/pentaho/PieChart if you're running on your machine. Let me know if this helps.

    The PieChart maps to /jsp/PieChart.jsp .

    -Mike

  3. #3
    Join Date
    Apr 2006
    Posts
    3

    Default Re:Howto create a pie chart?

    Hi mdamour,

    thank you for your answer. I have tried to understand the example, but unfortunate i'm not a jsp programmer.
    Is there an other way to create a chart with the workbench or with iReport at the moment?

    Best regards

    Holger Koch

  4. #4
    Join Date
    Feb 2006
    Posts
    9

    Default Re:Howto create a pie chart?

    Hi all !

    I have the same problem, I wish to modify the example given with the pentaho demo to understand pentaho's full capabilities. However, I have been unable to find how to change the datasource of the Chart to point to my Sql database.

    I am probably not looking in the right direction.

    All help would be appreciated.
    Matthieu

  5. #5
    Join Date
    Apr 2006
    Posts
    3

    Default Re:Howto create a pie chart?

    Hi,

    may be i can help you.

    in the file PieChart.jsp in line 40 is an Entry

    "IPentahoConnection connection = PentahoConnectionFactory.getConnection("SQLDatasource", null);"

    with the Name "SQLDatasource" is the JNDI Datasource in the file pentaho.xml involved.

    I think you should create a new JNDI Datasource and change the name in the PieChart.jsp example.

    I have also a question. Is it right, that pentaho has 3 options to create a chart?
    * programm it in jsp
    * create it with the workbench
    * create it with an jasper/jfree designer, for example iReport

    Can anybody tell me, that he have seen an working chart that is not a jsp programm? (Why are only jsp examples includes?)

    best regards

  6. #6
    Join Date
    Jan 2006
    Posts
    460

    Default Re:Howto create a pie chart?

    This is not ideal since it still says 'Action Successful' on the top, but see what this does:

    function show(theChartFile) {
    return "<IMG SRC=\\"getImage?image=" + theChartFile + "\\">";
    }

    Just replace your show method. I'm sure there is a perfect way of doing this, I'll have to ask Marc.

    I also made a code change for the ChartComponent so that if no output is specified then it will write the chart directly to the 'default output stream'. This means that in the future you'll be able to create chart action sequences that display a chart directly to the browser without a Javascript rule. You can still chain the results to another component by specifiying an output.

    -Mike

  7. #7
    Join Date
    Feb 2006
    Posts
    9

    Default Re:Howto create a pie chart?

    -Mike,

    Thanks for your help, however, this line : PentahoConnectionFactory.getConnection("SQLDatasource", null);"
    doesn't seem to refer to the JNDI. Most examples point to the JNDI called "SampleData", which I found, but since I already created an parallel access to my database. The access I created works fine with others examples, reports and the like, so I just wanted to use it for the Charts too. It may help if I had access to the PentahoConnectionFactory class, but, being a .class file... and I can't find its source.

    As for your question, I only know that you cannot use the workbench wizard to create charts. Apart from that, I don't know.

    I'll be waiting for any other ideas,

    Matthieu

  8. #8
    Join Date
    Dec 2005
    Posts
    7

    Default Re:Howto create a pie chart?

    Please see the pentaho.xml file, in this file you can write other datasource for the chart

  9. #9
    Join Date
    Dec 2005
    Posts
    7

    Default Re:Howto create a pie chart?

    Please see the pentaho.xml file, in this file you can write other datasource for the chart

  10. #10
    Join Date
    Dec 2005
    Posts
    7

    Default Re:Howto create a pie chart?

    Please see the pentaho.xml file, in this file you can write other datasource for the chart

  11. #11
    Join Date
    Feb 2006
    Posts
    9

    Default Re:Howto create a pie chart?

    Thank you, this was what I was looking for.

    Matthieu.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.