Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Provide data to chart components from the dashboard
#1
Can we provide  data to the chart components from the designer without using a dataset service ?

(12-23-2022, 11:06 AM)harshabalan Wrote: Can we provide  data to the chart components from the designer without using a dataset service ?

Ans: Yes . we can provide the data to charts as a json structure  ; 
In the below example we are getting dynamic informations from the dashboard which we are formulatiing into a json structure and providing the same to a datagrid.

var f1 = sdk.getValue( 'label744');   //// value : "Document: Revenue"
var f2 = sdk.getValue( 'label748');   /// value : "Applied filter : Last 7 Day"
var f3 = sdk.getValue( 'label756');  /// value : "Section : Quarterly report"
var info  = [f1,f2,f3];
var info_val =[];
 for (var i = 0; i <= info.length; i++)
{
info_val.push({"info":info[i]});   //////
}
var ch = sdk.getWidget('datagrid770' );
ch.setDataProvider(info_val);
ch.draw();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)