Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to access the result set with Query Component in RequireJS dashboard?

  1. #1
    Join Date
    Aug 2013
    Posts
    100

    Default How to access the result set with Query Component in RequireJS dashboard?

    I am using Pentaho 7.1 CE and creating CDE dashboard.In Pentaho 7 by default require.js support in enable. Then add a Query Component. Provide out the usual settings, define a Result Var name, e.g. dataset.Then I have added D3 code to the PostExecution function.Also, i have to prepare the dataset with the compatibility of D3.Before without requireJS, we are calling the result variable name in the PostExecutionfunction like i have mentioned below :

    function ()
    {
    var data = [];


    for(var i=0; i < dataset.length; i++){
    var dataObject = {};
    dataObject.letter = dataset1[i][0];
    dataObject.frequency = dataset1[i][1];
    data.push(dataObject);
    }
    // D3 chart code.
    }

    But i am struggling to make the same function working with require.js.Now I can't find where this info is held? Does anybody know if this is till possible or what the solution is now?

  2. #2
    Join Date
    Aug 2013
    Posts
    100

    Default

    resolving this issue by using below mentioned function :
    function ()
    {
    var data=[];
    var len= this.dashboard.getParameterValue('dataset');
    for(var i=0; i < len; i++){
    var dataObject = {};
    dataObject.letter = this.dashboard.getParameterValue('dataset')[i][0];
    dataObject.frequency = this.dashboard.getParameterValue('dataset')[i][1];
    data.push(dataObject);
    }
    }

Tags for this Thread

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.