Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 11

Thread: Parametrized Dial Chart Issues

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Posts
    27

    Default Parametrized Dial Chart Issues

    Good mornig folks!

    I would like to change not only the value of the dial-needle but also of the min/max limits and color boundaries. At the moment I'm able to do that using an xml file, passed with resource tag, in the .xaction file.

    I was hoping to do 2 things:

    1) pass a parameter dynamically by clicking on a previous report and to change the dial chart values and title/subtitle change according to that

    2) do the exact same thing but for more than one dial chart at the time(they are called dial grid chart, I think). I suppose I should use the <loop> tag, but I don't understand exactly how to apply it.

    Any ideas?

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

    Default

    CDF dialchart component supports that, check the docs
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Dec 2009
    Posts
    27

    Default

    Thanks for the quick reply.

    I already have but I guess I'm doing something wrong. I've made few other dashboards and they interact fine but here I've encountered problems. I'll try to be more specific:

    1) In the template.html I've added

    Code:
    components[components.length] = {
    name: "dialChart01", type: "XactionComponent",
    solution: solution, path: path,
    action: "dialChart01.xaction",
    listeners: [param_product],
    parameters: [["product", param_product]],
    htmlObject: "dialChart01",
    executeAtStart: true
    }
    2) and in dialChart01.xaction:
    Code:
    <title><![CDATA[Product - ]]>{PRODUCT}</title>
    but nothing has changed.
    And if I do the same thing( <![CDATA[Product - ]]>{PRODUCT}) in the .xml resource file, should the result be the same?

    What am I missing?

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

    Default

    parameters: [["product", param_product]], <- you're missing quotes in "param_product"
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  5. #5
    Join Date
    Dec 2009
    Posts
    27

    Default

    Uhm, I think that's not it, 'cause I've defined that parmeter previously:
    Code:
    var param_product = "product";
    Dashboards.setParameter(param_product, "APPLE");
    IMHO it would be enough to eliminate the widget file and include all the necessary tags in the .xaction file. Why don't you do it than, you'll ask..
    Well, I'm trying but I always get some kind of
    HTML Code:
    Error: RuntimeContext.ERROR_0012

    error
    (the error log is not of a much help).

    As written in
    http://wiki.pentaho.com/display/Serv...ties+Reference

    I should place the <interval></interval> tags inside of <chart-attributes></chart-attributes> tags, right?
    Well, it's not working

  6. #6
    Join Date
    Jan 2006
    Posts
    245

    Default

    Vlad,

    it is not clear to me the approach you're following to change the title of your dial chart using a <title> element in the xaction but I think it is far more easy to use a TextComponent and manipulate DOM elements directly inside the html page based on your selection.

    To do that you can look at the samples that came with the product where you can find a lot of these cases. For example if you look at the "Pentaho Home Dashboard" sample there you've got a sample where clicking on a widget and changes the productLine or territory parametersand builds a new title string that is used to update the title of the page.

    I think, if I not misunderstood, what you want to do with your dialchart. The same approach can be applied to multiple widgets on your page after having divided the page properly and defined more TextComponent that works appropriately. That solves your second issue I think.

    I hope I've correctly understood your question and that my answer can be useful.

    Regards

    Sergio
    Last edited by sramazzina; 07-06-2010 at 12:55 PM.
    Follow Me on Twitter: sramazzina
    My Skype account: sramazzina
    My Blog
    View my profile on LinkedIn: http://www.linkedin.com/in/sramazzina
    Author of Pentaho Data Integration Kitchen How-To and Pentaho Business Analytics Cookbook

    Join us on IRC server Freenode.net, channel ##pentaho ##saiku

  7. #7
    Join Date
    Dec 2009
    Posts
    27

    Default

    Hi Sergio,

    thank you for the hint. Actually what I realy want to do is a bit more complicated and I've used the <title> tag just to keep the things simple. As a matter of fact I would like to:

    retrieve the values with a sql query in .xaction file and send the following parameters to a .xml file: value, min, max, interval/low, interval/medium, interval/high.

    The first three values are a piece of cake: I just create a result-set as (value, min, max) and that works fine. I can see that it works because the needle moves correctly. However, the min and the max value are hard-coded in the dialchart.xml and I don't know how to pass the values to it. The same stands for <interval> tags.

    If I'm not wrong you suggest to do like in Sales_by_Territory.xaction and territory.widget.xml, more precisely:
    Code:
    <data>
            <data-solution>steel-wheels</data-solution>
            <data-path>dashboards</data-path>
            <data-action>Sales_by_Territory.xaction</data-action>
    
            <data-output>swresult</data-output>
            <data-name>TERRITORY</data-name>
            <data-value>SOLD_PRICE</data-value>
    
            <data-orientation>columns</data-orientation>
        </data>
    In my case I should be able to reproduce this for

    Code:
    <interval>
                <label>medium</label>
                <minimum>30</minimum>
                <maximum>70</maximum>
            </interval>
    How can I pass these parameters into the .xml?It would be nice to have a final result as below:

    Code:
    <data-action>DialChart_data.xaction</data-action>
    
            <data-output>dial_results</data-output>
            <data-name>VALUE</data-name>
            <data-value>MIN</data-value>
            <data-value>MAX</data-value>
            <data-value>INTERVAL_TRESHOLD_ONE</data-value>
            <data-value>INTERVAL_TRESHOLD_TWO</data-value>
    and afterwards:

    Code:
    <interval>
                <label>medium</label>
                <minimum>{INTERVAL_TRESHBOLD_ONE}</minimum>
                <maximum>{INTERVAL_TRESHOLD_TWO}</maximum>
            </interval>
    Thanks,
    Vlad

  8. #8
    Join Date
    Jan 2006
    Posts
    245

    Default

    Vlad,

    I'm sorry but I've not understood you're not using CDF to do that isn't it? Apologize me. The sample I was pointing you isn't the sample you're looking into but uses the native Pentaho dashboarding capabilities.

    Have you tried using CDF for your dashboard? It's easier, give it a try you've dialcharts also there.

    S.
    Follow Me on Twitter: sramazzina
    My Skype account: sramazzina
    My Blog
    View my profile on LinkedIn: http://www.linkedin.com/in/sramazzina
    Author of Pentaho Data Integration Kitchen How-To and Pentaho Business Analytics Cookbook

    Join us on IRC server Freenode.net, channel ##pentaho ##saiku

  9. #9
    Join Date
    Dec 2009
    Posts
    27

    Default

    Hi
    I am using the CDF components and from how I see it, one thing doesn't excludes the other. I use template.xcdf file to start the dashboard file myDashboard-template.html. There I set the interaction between the single reports, passing parameters from one to another.

    Anyway, at this point, I think that my problems are related to the internal dynamics of the dial chart itself, 'cause I can't find any suitable documentation. If you know any alternative method to achieve what I've described, I'll be happy if you are willing to explain it to me.

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.