Chart widgets use the Highcharts library. All attributes are JSON objects.
The attributes which can be set comprise:
Figure 181: Highcharts configuration options
General attributes:
localization
Localized values, i.e., "de: {subject:'Thema', yes:'Ja'}, en: {subject:'Subject', yes:'Yes'}".
The localization attribute can provide the localized values for all string attributes used in the widget script.
For example (see example with graphical user interface below), you need values for the attributes title and footer, than you can set three attributes:
attribute: title, value _('titlestring')
attribute footer, value _('footerstring')
attribute localization which provides localized values for both. Value de:{titlestring:'Offene Tickets: ',footerstring:'Anzahl bearbeitbare Tickets'}, en:{titlestring:'Open tickets: ', footerstring:'Number of accessible tickets'}
You can set values for attributes in the Admin Tool script, as shown in the following script for the three strings all, own, and unassigned.
Figure 182: Localizing page customization attributes in an Admin Tool script
Please note that it does not matter if you provide the values for the attributes using a script or by entering the values using the graphical user interface for the Page Customization! You might also use the following way of localizing values (an example of a KPI widget):
Figure 183: Localizing string Page Customization attributes using the graphical user interface
visible
Defines if the widget is displayed, true or false.
Highchart-specific attributes:
chart = "type:'column', pltShadow:false, backgroundColor:'#4dc245', height:
300";"items: [{html:'sometext', style: { left: '100px'; }}]"
labels = "items: [{html:'sometext', style: { left: '100px'; }}]"
The following example shows the widget TicketsInView and explains the logic of the associated Admin Tool script ticketsInViewDataWidget.groovy. For the entire script, please see the code block above. Here, the lines of code are set in relation to the GUI elements which they configure.
Figure 184: Chart widget example with script code