Indicators - Formatting Colors & Fonts
Introduction
Use this script for granular formatting of an Indicator Widget.
Instructions:
Create your indicator widget and add it to the dashboard. Select the edit button and choose the Edit Script from the options menu on the top right.
Add the following script and adjust the options object based on your needs.
widget.on('processresult', function(w, e) {
var options = {
title: {
fontFamily: 'Helvetica, sans-serif',
fontWeight: 'bold',
fontSizes: {
big: 40,
medium: 30
},
color: 'green'
},
secondaryTitle: {
fontFamily: 'Helvetica, sans-serif',
fontWeight: 'bold',
fontSizes: {
big: 20,
medium: 10
},
color: 'blue'
},
secondaryValue: {
fontFamily: 'Helvetica, sans-serif',
fontStyle: 'italic',
color: 'yellow'
},
backgroundColor: 'gray'
};
w.indicatorInstance.setOptions('numericSimple', options);
});
-
Jay, is there any way to increase the canvas size at the same time?
I'm able to get big text via:
var options = {
value: {
fontSizes: {
big: '400pt'
},
},
};
w.indicatorInstance.setOptions('numericSimple', options);
});But, it's big text seen through a tiny window and increasing the canvas size seems to just stretch the visible pixels rather than increasing the size of the window.
Please sign in to leave a comment.
Comments
3 comments