Attributes for Chart Widgets

Chart widgets are configured in the type chartWidget or one of its subitems. They use the Highcharts library. All attributes are JSON objects.

The attributes which can be set comprise:

General attributes:

Highchart-specific attributes:

Example of a Chart Widget

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 (Configuration Script for Widgets). Here, the lines of code are set in relation to the GUI elements which they configure.

Figure 286: Chart widget example with script code

Funnel Charts

With charts of type funnel, funnel-like representations can be implemented as often used in sales funnels.

A funnel chart is implemented in the same way as other charts, only the sub-attribute type of the chart attribute has to be set to funnel. The following example shows a sales funnel chart implementation where fixed numbers are used in the script. Of course, in a real life implementation, these figures will have to be replaced by figures which are created dynamically from the current content of the database.

Figure 287: ConSol CM Web Client - Sales funnel widget

The following script is used:

return [title: "{text: _('title')}",

chart: "{type: 'funnel', \

marginLeft: '50', \

marginRight: '150'}",

plotOptions: "{series:{ height: '90%', \

width: '85%', \

neckWidth: '20%', \

neckHeight: '20%', \

dataLabels: {enabled:'true', \

format: '<b>{point.name}</b> ({point.y:,.0f})', \

softConnector: 'true'}}}",

visible: "true",

series: "[{name: _('users'), \

data: [[_('visits') , 15654], \

[_('downloads'), 4064], \

[_('requests') , 1987]]}]",

localization: "de: {title: 'Vertriebstrichter', \

users: 'Individuelle Benutzer', \

visits: 'Seitenaufrufe', \

downloads: 'Downloads', \

requests: 'Anfrage Preisliste'}, \

en: {title: 'Salesfunnel', \

users: 'Unique users', \

visits: 'Page visits', \

downloads: 'Downloads', \

requests: 'Requests for price list'}"

]

Code example 33: Groovy script for the implementation of a sales funnel chart on the Web Client Dashboard (with fixed numbers as example)