Forums
Provide data to chart components from the dashboard - Printable Version

+- Forums (https://bdn.bdb.ai)
+-- Forum: BDB Knowledge Base (https://bdn.bdb.ai/forumdisplay.php?fid=13)
+--- Forum: BDB Dashboards Designer (https://bdn.bdb.ai/forumdisplay.php?fid=43)
+---- Forum: BDB Designer Q & A (https://bdn.bdb.ai/forumdisplay.php?fid=16)
+---- Thread: Provide data to chart components from the dashboard (/showthread.php?tid=546)



Provide data to chart components from the dashboard - harshabalan - 12-23-2022

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();