Hitachi Vantara Pentaho Community Forums
Results 1 to 29 of 29

Thread: Flash Chart Component

  1. #1
    Join Date
    Mar 2008
    Posts
    141

    Default Flash Chart Component

    Hi all,

    Like 2 months ago somehow i found there was a new component made by Nicholas Goodman to build easy and lovely flash charts, the component is here:

    http://code.google.com/p/pentahoflashcharts/

    The first version they made was for bi-server 1.7 and they used OFC1 --- http://teethgrinder.co.uk/open-flash-chart/ (which work really nice and even you can make some charts drillable)

    When pentaho release the version 2.0 RC1 there was some works also in OFC2 (which use JSON) --- http://teethgrinder.co.uk/open-flash-chart-2/ ..... So they decided to upgrade to OFC2 (beta) in bi-server 2.0. The problem with OFC2 is that they have release a new release call HYPERION which allows some drill chart that in the first release of version 2 they have not. The version for bi-server 2.0 is in trunk in the svn.

    The aim of this post is 1st to encourage people to use this component. Is really easy to use and how is an xaction it works fine with the Community Dashboard Framework.

    And second if somebody knows how can i upgrade the component to use the new release i would be glad to know.

    Thanks
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  2. #2

    Default

    Carlos,
    I haven't yet upgraded to ofc2.0, then I'm not sure I can help you.
    Try overwrite open-flash-chart.swf with the latest version (hyperion).
    In your xaction, ddd in the JSON fragment, for each element, a string like this:

    "on-click": "onClickFunction_1"

    add in the template.html a javascript function named onClickFunction_1 like this:

    function onClickFunction_1( index )
    {
    alert( 'click on ' + index );
    }

    let me know if it works.
    Francesco

  3. #3
    Join Date
    Mar 2008
    Posts
    141

    Default

    Hi Francesco, thank you for your help. Your instructions worked perfectly!!!!

    In the version for bi-server 2.0 there is also a folder 'js' when i downloaded the Hyperion there is also this folder so i replaced this too (could have some changes ).

    Now i have a pie chart with on-click options, at least is working for a google address, so i should not have any problems with a function in my template.html

    Thanks
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  4. #4
    Join Date
    Jun 2005
    Posts
    144

    Default Couple of things

    We are working on an update to OFC2.0 and Pentaho 2.0. We have limited resources (just our spare time) to devote to this so we figured that OFC2.0 and Pentaho 2.0 would be the version combination that will last the longest (perhaps a year) so we're focusing on that.

    We hope to have something released within a couple of weeks of Pentaho 2.0 GA.

    Also - I didn't know that it worked well with the CDF. That's great. Happy to hear.

    Also, as much as I personally would like to take credit it for it, Tom Qin who is working for Bayon Technologies on contract is the real talent behind the component. He's the guy who wrote the code!

  5. #5
    Join Date
    Mar 2007
    Posts
    158

    Default How to get data from DB for OFC

    Hi,


    I want to know that how can we fetch data from database for generating flash charts using OFC? (Using Java Method not pHP)


    Thanks.

  6. #6
    Join Date
    Mar 2008
    Posts
    141

    Default

    Ok, It seems i was a bit lier in my first post. When I said

    it works fine with the Community Dashboard Framework.
    It works in pentaho 1.7, but it does not in bi-server 2.0. So i would like to know if somebody have had success using this with bi-server 2.0 and CDF 2.1...

    Could be a problem with the new CDF 2.1-RC1, or a problem with bi-server 2.0 RC1 or a problem with OFC 2.0. I want my CDF dashboards with Flash Charts again...

    And varungaur82,

    I want to know that how can we fetch data from database for generating flash charts using OFC? (Using Java Method not pHP)
    Are you going to use OFC with pentaho? or are you just asking about OFC in general cause there is another forum for that

    http://forums.openflashchart.com/

    Thanks
    Last edited by cegarcia; 12-09-2008 at 03:15 PM.
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  7. #7
    Join Date
    Mar 2008
    Posts
    141

    Default Flash Chart in CDF bi-server 2.0

    Hi guys, i do not too much about java so it could happend i would say something wrong. But this is what happend.

    I have the OpenFlashChartComponent.java for bi-server 2.0 which doesnt work with CDF. I have compare this with the OpenFlashChartComponent.java for version 1.7 and there is a difference in the way the html-fragment is created. here is the difference:

    OpenFlashChartComponent for bi-server 2.0
    Code:
    flashFragment =" <script type='text/javascript' src='{ofc-url}/js/swfobject.js'></script> <script type='text/javascript'>swfobject.embedSWF('{ofc-url}/open-flash-chart.swf', 'my_chart', '{chart-width}','{chart-height}','9.0.0', 'expressInstall.swf',{'data-file':'{data}'});</script><div id='my_chart'></div>";
    OpenFlashChartComponent for pentaho 1.7
    Code:
    flashFragment ="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'"+
    "codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'"+
    "width='{chart-width}' height='{chart-height}' id='graph-2' align='middle'>"+
    "<param name='allowScriptAccess' value='sameDomain' />"+
    "<param name='movie' value='{ofc-url}?width={chart-width}&height={chart-height}&data={data}' />"+
    "<param name='quality' value='high' /><param name='bgcolor' value='#FFFFFF' /> "+
    "<embed src='{ofc-url}?width={chart-width}&height={chart-height}&data={data}' quality='high' bgcolor='#FFFFFF'"+
    "width='{chart-width}' height='{chart-height}' name='open-flash-chart' align='middle' allowScriptAccess='sameDomain'"+
    "type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> </object>";
    I have replace the code from 1.7 to 2.0 but i have an error which i almost sure is because in the 1.7 i do not have the this
    Code:
    <script type='text/javascript' src='{ofc-url}/js/swfobject.js'></script
    >

    Where can i write this in the 1.7 code so this can work with CDF in bi-server 2.0


    Pd. I have also created a .jar with the old version OFC1.0 to work in bi-server 2.0 if someone wants...

    Thanks
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  8. #8

    Default

    Carlos,
    what happens if you execute your xaction in the design studio's test window? Is your flash chart displayed correctly?
    And if you write in a new browser window the url of your xaction, what happens?
    If you can display it well, the problem is in the cdf, otherwise is in the OpenFlashChartComponent
    Francesco

  9. #9
    Join Date
    Oct 2008
    Posts
    9

    Default I get same probleme do it myself

    Hi

    i'm new to pentaho i dont know where to commit and get access anyway, this
    my little contrib ... With this openflash work like a charm and i add wmode
    tranparent for date control can diplay in front of flash swf.

    1. Get openflashchart for BI2.0 intall it and be sure that's work !
    (I get the last official OFC2 swf and replace the pentaho openflashcart
    one. dont know if it's really usefull)

    2. get swfobject 2.1 :
    http://code.google.com/p/swfobject/downloads/list
    and copy swfobject.js to /tomcat/webapps/pentaho/js

    In pentaho-solutions/system/custom/teemplate-dashboard.html
    add in <head> the code :
    <script language="javascript" src="/pentaho/js/swfobject.js"></script>


    3. Add in
    /tomcat/webapps/pentaho/js/Dashboards.js

    in the update function after xaction case :

    case "openFlashChart":
    //go through parametere array and update values
    var p = new Array(object.parameters.length);

    for(var i= 0, len = p.length; i < len; i++){
    var key = object.parameters[i][0];
    var value = eval(object.parameters[i][1]);
    p[i] = [key,value];
    }

    var flashvars = {
    "data-file": pentahoAction(object.solution, object.path, object.action,
    p,null)
    };
    var params = {
    wmode: "transparent"
    };

    var attributes = {}
    swfobject.embedSWF("/pentaho-style/images/open-flash-chart.swf",
    object.htmlObject , object.chart_width, object.chart_height, "9.0.0","",
    flashvars, params, attributes);
    break;

    4. just set url url_content in the output parameters of you .xaction

    5. add in your template like other cdf object :

    regionVarianceBarChart =
    {
    name: "regionVarianceBarChart",
    type: "openFlashChart",
    solution: "dashboards",
    path: "test",
    action: "visite_hit_by_month_bar_chart_flash.xaction",
    chart_width: 640,
    chart_height: 480,
    listeners:["dateStart"],
    parameters: [["dateInput", "dateStart"]],
    htmlObject: "object_2",
    executeAtStart: true,
    }

    hope that help

    Sorry for my english

    http://code.google.com/p/swfobject/downloads/list

  10. #10
    Join Date
    Dec 2005
    Posts
    531

    Default

    Hi goofy03,

    actually that would be a contribution to CDF and not Pentaho. ;-)

    Very nice, let's see if we can get that into the next CDF version.

    Regards,
    Ingo

  11. #11
    Join Date
    Mar 2008
    Posts
    141

    Default a new problem

    Hi goofy03,

    Thanks for your code. The idea of the transparency is super!!! now i even can see when i update the repository the ok window which i couldnt see before cause was under the flashchart.

    A couple of things:

    2. get swfobject 2.1 :
    http://code.google.com/p/swfobject/downloads/list
    and copy swfobject.js to /tomcat/webapps/pentaho/js


    In pentaho-solutions/system/custom/teemplate-dashboard.html
    add in <head> the code :
    <script language="javascript" src="/pentaho/js/swfobject.js"></script>
    The tutorial in http://code.google.com/p/pentahoflashcharts/ for bi-server 2.0 says is necesary to put a js folder in /pentaho-style/images/js/ and here is the same swfobject.js so for me was not necesary to download this file and jsut change the src.


    4. just set url url_content in the output parameters of you .xaction
    The name of the output must be content_url


    I had to change a little bit my xaction cause i wanted to show a report or a chart based in a selection of a radio button and i was just using a single xaction for that. As now i have a ne CDF type ("openFlashComponent") I had to change the way using 2 xaction one for the report another for the chart. But here comes my
    new problem, my flash chart is being shown in CDF but i cannot clean the html object neither using Dashboards.clear() or document.getElementById(chartObject).innerHTML = "";


    Any ideas???

    Thanks a lot...!!!
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  12. #12
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Thanks guys.

    Glad it's working.

    I have on my todo list to make a OFC component tightly integrated to the cdf. I'm sure this will help a lot
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  13. #13
    Join Date
    Mar 2008
    Posts
    141

    Default cannot clean the flashChartComponent object in CDF

    This is at the end of my last post, i just decided to put it alone cause could be not seen, read....!!!

    I had to change a little bit my xaction cause i wanted to show a report or a chart based in a selection of a radio button and i was just using a single xaction for that. As now i have a ne CDF type ("openFlashComponent") I had to change the way using 2 xaction one for the report another for the chart. But here comes my new problem, my flash chart is being shown in CDF but i cannot clean the html object neither using Dashboards.clear() or document.getElementById(chartObject).innerHTML = "";

    Any ideas???

    Thanks
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  14. #14
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    document.getElementById('the option you put on the htmlObject parameter').innerHTML = ""; should work
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  15. #15
    Join Date
    Mar 2008
    Posts
    141

    Default

    The option document.getElementById('the option you put on the htmlObject parameter').innerHTML = ""; dindt work alone i had to add:

    document.getElementById('the option you put on the htmlObject parameter').height ="0";
    document.getElementById('the option you put on the htmlObject parameter').width = "0";
    document.getElementById('the option you put on the htmlObject parameter').style.visibility ="hidden";

    And now my flash chart is being hided.

    Thanks!!... Now i have CDF with PFC with OFC2.0 Hyperion!!!... lots of letters is making me mad!!!...
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  16. #16
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    I'm not conviced but glad it's working
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  17. #17

    Default

    Hi,

    Can anyone let me know some ideas how to build a complete dashboard( like steelwheels revenue dashboard) using OFC-2 in pentaho.

    OFC-2 simple charts are working fine.But i want to add drill down capabilities.

    Any Ideas would be great!!!


    Thanks
    Amit
    Cheers !!!

    Amit @ Fiserv

  18. #18
    Join Date
    Oct 2008
    Posts
    9

    Default

    Same problem here the only click event i have found is on the point in line chart but nothing for barchart piechart etc ...

    if someone have found solutions ? better than wait the next OFC version ;-)

    Quote Originally Posted by mishra.amit64 View Post
    Hi,

    Can anyone let me know some ideas how to build a complete dashboard( like steelwheels revenue dashboard) using OFC-2 in pentaho.

    OFC-2 simple charts are working fine.But i want to add drill down capabilities.

    Any Ideas would be great!!!


    Thanks
    Amit

  19. #19
    Join Date
    Mar 2008
    Posts
    141

    Default

    Hi goofy03, mishra.amit64:

    I am not sure if OFC2.0 have on-click events for bar chart, but in the OFC2 Gamera and Hyperion version they have added on-click in the pie chart. You could give a try with the bar charts also...

    Another solution instead of waiting for the next OFC release you could use the OFC v1.0 with bi-server 2.0. The OFC v1.0 works good enough with the links... I have both of the version working in my bi-server 2.0, i just compiled the old version to work with bi-server 2.0.

    HIH
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  20. #20
    nanuganga Guest

    Default Thanks for open flash chart instruction

    Guys thanks, this post was quite helpful

  21. #21

    Default

    Thanks Carlosg,

    I m working on the same...ll update here...

    By the way can you please guide me implementing CDF in biserver2.0.

    I think there has been lot of changes done for v2.0 CE

    So the old JSP are not working.

    Below is the proc. that i am following with PCI V2.0

    1. Copy Dashboard.jsp in Pentaho web app JSP-folder
    2. Map new Dashboard.jsp in web.xml according to other Pentaho JSP pages
    3. Copy dashboard-links.xsl into pentaho-solutions/system/custom/xsl
    4. Copy template-dashboard.html into pentaho-solutions/system/custom
    5. Copy dashboards solution into pentaho-solutions folder

    can you please let me know if the above proc is correct?
    Cheers !!!

    Amit @ Fiserv

  22. #22

    Default

    carlos,

    with pentaho 1.7GA klose_dashboard_framework is working fine.

    I also tried and converted the normal region pie chart to flash pie chart, in the same example of klose dashboard_framework.

    But now i am not able to do the drill down.

    In my flash pie chart i added the component definition part that is there with the normal drill down pie chart.But not able to do the drill down.

    in xml section of the xaction my component-definition for flash pie chart looks like:

    <component-definition>
    <url-template><![CDATA[javascript:loadRegionVariance('{region}')]]></url-template>
    <paramName>region</paramName>
    <use-base-url>false</use-base-url>
    <url-target>_self</url-target>
    </component-definition>


    I am using pentaho 1.7 GA and ofc 1

    Can you you please guide me the necessary steps to achieve drill down in flsh charts(ofc1+pentaho 1.7)

    Thanks!!!
    Cheers !!!

    Amit @ Fiserv

  23. #23

    Exclamation please guide me.

    Hi,
    I am new to pentaho. how to openflash integrate with pentaho.please guide me.I have good experince create report.


    Thanks
    mohan

  24. #24
    Join Date
    Mar 2008
    Posts
    141

    Default

    Hi mishra.amit64, Sorry I did not reply to you before I was on holidays!!!

    About CDF and bi-server 2.0 i have seen in another post you have already integrated this.

    Links in pentaho 1.7 or bi-server 2.0 and OFC1.0.... I do not use the a component definition to create my chart, what i do is create a .txt file with the template of the chart like this:

    Code:
    &title={title},{color: #7E97A6; font-size: 14; text-align: center}& 
    &x_label_style=8,#164166,2,1,#818D9D&
    &x_axis_steps=1&
    &y_legend=%25 EFICIENCIA,12,#164166& 
    &y2_legend=UNIDADES,12,#164166&
    &y_ticks=5,10,10&
    &bar_glass=50,#FF9933,#000000,%25 Eficiencia,10&
    &bar_glass_2=50,#000000,#000000,Unidades,10&
    &values={col2}& 
    &values_2={col3}&
    &line_3=2,#FF0000,Meta,10,4& 
    &values_3={col5}&
    &line_4=2,#2693CF,Meta Unidades,10,4& 
    &values_4={col4}& 
    &y2_lines=2,4& 
    &show_y2=true& 
    &x_labels={col1}& 
    &bg_colour=#FFFFFF& 
    &x_axis_colour=#818D9D& 
    &x_grid_colour=#F0F0F0& 
    &y_axis_colour=#818D9D& 
    &y_grid_colour=#ADB5C7& 
    &y2_axis_colour=#164166& 
    &tool_tip=%23key%23%3Cbr%3E%23val%23+%28%23x_label%23%29&
    &y2_max=180000&
    &y2_min=0&
    &y_max=100&
    &y_min=0&
    &links={col6}&
    And as you can see the last line is links with a reference to the 6th column (for my case a relational query) and is a javascript function which is in my cdf template.html the query is:

    Code:
    select maquina, eficiencia* 100 as "eficiencia", unidades, meta_unidades, 70, 'javascript:nueva_ventana_maquina("' || maquina || '")' as "URL"
    from eficiencia_maquina
    And inside this function you can have a firechange or whatever you want...

    HIH
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  25. #25

    Default

    Thank you very much carlos...

    I ll follow your procedure and let you know the result...

    btw i have already integrated CDF2.1 with pentaho 2.0, i am facing couple of problems below

    1. when i call the dashboards.jsp in browser i am getting a blank page and there is some problem in transmenu.js file in PCI v2.0 its saying the oActuator param is null.In pentaho user console i can rander the dashboard without having any problem.

    2. As i said i am converting normal charts to flash charts in the same example and trying to check the drill-thru.but with cdf2.1 and pci v2.0 even in the user console i am not able to view the flash charts.

    would appreciate your suggestions.

    Thanks!!!
    Cheers !!!

    Amit @ Fiserv

  26. #26
    Join Date
    Mar 2008
    Posts
    141

    Default

    Hi mishra.amit64,

    In thread http://forums.pentaho.org/showthread...ctuator&page=2 there is a post of pmalves

    It's not a CDF issue, that's an error in a pentaho file, transmenu.js
    I remember needing to edit that file and add a test to see if that object was null. IIRC, that only happened in IE, not FF.
    I havent fixed this cause i use FF, but if you fixed you could write a detail explanation.

    And about the CDF 2.1, bi-server 2.0 and Flash Chart Component, if you read all this thread at the beggining there is a post of goofy03 with an explanation of the thing you should do to have Flash Chart working,

    HIH
    Last edited by cegarcia; 01-06-2009 at 09:31 AM.
    Carlos E. Garcia
    BI Analyst
    www.sapian.com.co

  27. #27

    Default

    Thanks Carlos...

    drill-thru in flash charts are working fine for me.
    i have tested it with PCI1.7+klose dashboard framework+OFC1
    right now i am checking this with pci2.0+cdf2.1+ofc2

    thanks for your suggestion

    Thank You again!!!
    Cheers !!!

    Amit @ Fiserv

  28. #28

    Default

    Hi,

    I tested transmenu.js and i am getting oActuator = null

    thats why i am not getting Dashboard.jsp in browser(both in IE and FF)

    how to rectify this?

    Is there a new transmenu.js file available for PCI2.0?



    Thanks!!!
    Cheers !!!

    Amit @ Fiserv

  29. #29

    Default unable to see Flash Chart examples

    Hi

    I am unable to see Flash Chart Examples on Pentaho BI Server. I am shown a blank page. Meanwhile, I 've downloaded adobe flash thru synaptic manager (ubuntu)
    anythign missing?

    thx
    naveen

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.