Widget Script Editor - Launching and Passing JAQL Query Results to Widget Properties

Comments

1 comment

  • Avatar
    Anna Naidion

    Hi Reginald,

     

    Thanks for posting this.

    Below I am going to explain a common approach:

    • You need to execute JAQL request. It can be accomplished with the next code:
    var payload; /*Specify JAQL request here*/
    var datasource = 'cubeName'
    var data = $.ajax({
      url: '/api/datasources/'+datasource +'/jaql',
      type: 'POST',
      contentType: 'application/json',
      async: false,
      data: JSON.stringify(payload)
    }).responseJSON

    As a value of the parameter [data] you will get the response to this request.

    • Add a new line to the chart. A sample of a realization can be found in the plugin 'Predictive Trend Line'. In this plugin, you can find how data are added with the function startRegression() (file regression.js).

    Regards, Anna

    0
    Comment actions Permalink

Please sign in to leave a comment.