12-22-2022, 05:57 AM
(This post was last modified: 12-22-2022, 05:59 AM by neeraja.pattathil@bdb.ai.)
What script can be used to show the data label when the "apply Auto Manipulator" script is used?
// in dashboard
//---------json for CS by Nmsc
DataSet.prototype.updateAutoJson = function (json) {
if( this.m_id == 'ComponentID1'){
switch(json.Name){
case "MM5":
json.Color='#673AB7';
json.ChartType = "line";
json.PlotType = "point";
json.PlotRadius = "4";
break;
default:
json.ChartType = "column";
json.PlotType = "point";
json.PlotRadius = "4";
json.DataLabelCustomProperties = {
"useFieldColor" : "false",
"showDataLabel": "true",
"dataLabelTextAlign" : "center",
"dataLabelFontColor" : "#c2c2d9",
"dataLabelRotation" : "0",
"dataLabelFontSize" : "10",
"datalabelFontStyle" : "normal",
"datalabelFontWeight" : "normal",
"datalabelFontFamily" : "'Raleway', sans-serif",
"datalabelField" : json.Name,
"datalabelPosition" : "Top",
"dataLabelUseComponentFormater": true,
"datalabelFormaterUnit":"none",
"datalabelFormaterPrecision":"default",
"datalabelFormaterCurrency":"none",
"datalabelFormaterPosition":"suffix"
};
}
}
return json;
};
// in dashboard
//---------json for CS by Nmsc
DataSet.prototype.updateAutoJson = function (json) {
if( this.m_id == 'ComponentID1'){
switch(json.Name){
case "MM5":
json.Color='#673AB7';
json.ChartType = "line";
json.PlotType = "point";
json.PlotRadius = "4";
break;
default:
json.ChartType = "column";
json.PlotType = "point";
json.PlotRadius = "4";
json.DataLabelCustomProperties = {
"useFieldColor" : "false",
"showDataLabel": "true",
"dataLabelTextAlign" : "center",
"dataLabelFontColor" : "#c2c2d9",
"dataLabelRotation" : "0",
"dataLabelFontSize" : "10",
"datalabelFontStyle" : "normal",
"datalabelFontWeight" : "normal",
"datalabelFontFamily" : "'Raleway', sans-serif",
"datalabelField" : json.Name,
"datalabelPosition" : "Top",
"dataLabelUseComponentFormater": true,
"datalabelFormaterUnit":"none",
"datalabelFormaterPrecision":"default",
"datalabelFormaterCurrency":"none",
"datalabelFormaterPosition":"suffix"
};
}
}
return json;
};