Forums
Padding Script for component - 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: Padding Script for component (/showthread.php?tid=364)



Padding Script for component - neeraja.pattathil@bdb.ai - 12-22-2022

How to adjust the padding for the components using the script?

//script in dashboard 

var arr = ['ComponentID1'];
for(var i=0;i<arr.length;i++){
var comp=sdk.getWidget( arr[i] );
comp.m_chartpaddings.leftBorderToDescription = 2;
comp.m_chartpaddings.leftDescriptionToMarkers = 2;
comp.m_chartpaddings.leftMarkersToLine = 2;
comp.m_chartpaddings.bottomBorderToDescription = 10;
comp.m_chartpaddings.bottomDescriptionToMarkers = 10;
comp.m_chartpaddings.bottomMarkersToLine = 5;
comp.m_chartpaddings.rightDescriptionToMarkers = 2;
comp.m_chartpaddings.rightMarkersToLine = 2;
comp.m_chartpaddings.rightBorderToLegend = 15;
comp.m_chartpaddings.topTitleToSubtitle = 10;
comp.m_chartpaddings.topSubtitleToChart = 15;
comp.m_chartpaddings.chartToBorder = 10;

}