Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Triggering a popup component by clicking on a chart created with protovis component

  1. #1
    Join Date
    Feb 2013
    Posts
    21

    Default Triggering a popup component by clicking on a chart created with protovis component

    I have created a bar chart using a protovis component. Now, I want to trigger a popup component by clicking on a bar.
    Usually, when I use a popup component using a built-in chart component, I make it clickable and enter a click function like this :
    Code:
    function f(e) { render_popup1.popup($(e.target)); }
    It worked fine, but, in the protovis component, I tried something like this :
    Code:
    vis.add(pv.Bar)        
            .data(data)
            .bottom(0)
            .width(10)
            .left(function() {return this.index+10);})
            .height(function(d) {return d*graphScale;})
            .event("click", function(d,e) {render_drillPopup.popup($(e.target))})
    It doesn't work. In the console, it says that e is undefined.

    Can you please help me to solve this probleme ?

    Thanks in advance !

  2. #2
    Join Date
    Mar 2012
    Posts
    645

    Default

    Use pv.event, instead of the "e" argument. I'm not sure why e is undefined.
    Note that e is the last argument of a handler, so e = arguments[arguments.length-1] will be safer.
    Depending on the number of ascendant marks of Bar, "e" can be the second, third, fourth argument.
    Last edited by duarte.leao; 02-22-2013 at 11:49 AM.

  3. #3
    Join Date
    Feb 2013
    Posts
    21

    Default

    It worked ! Thank you very much for your answer. It was of a great help !
    If only you could help me resolve another problem : I want to create a pivot table inside of my dashboard. So, I used a table component and put a MDX query as the datasource. It works fine, but something is missing : A sum column per row and a sum row per columns. Is there a way to add them in my table ? (Maybe by using the table's draw function, or extra options ? )
    Thanks again !

  4. #4
    Join Date
    Feb 2013
    Posts
    21

    Default

    It worked ! Thank you very much for your answer ! It was of a great help !

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.