In dashboard elements, there is the option of adding a scripted pie chart, I have tried to search the docs for an example but could not find any. Are there any guides on making a scripted pie chart?
Thanks,
ahasbini
			
			
			
				Specifically, an example on the script used in the Scripted Pie Chart to display in the dashboard based on some logic that retrieves data from DCIs.
Thanks.
			
			
			
				Scripted bar or pie charts either accept array with values:
return [1,2,3];
or hashmap, which allows to provide names in additions to values:
v = %{};
v["name1"] = 1;
v["name2"] = 2;
v["name3"] = 3;
return v;
Functions to get DCI values are described here https://www.netxms.org/documentation/nxsl-latest/#func-getdcivaluebyname
I can provide a detailed example of how to use them in the coming days (you can give some details on what data do you need)
			
			
			
				Thanks a million, I just couldn't figure out the map or array part out from the docs so I had to ask. I'm familiar with the DCI part, so I will give it a try. Thanks again.
			
			
			
				Hi,
If you need to specify colors for each item, the hashmap can be used for this:
values.append(%{"name":"Item X", "value":10, "color": "#f5f5f5"});
return values;