Forums

Full Version: Data label script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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;
};