Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: PFUN-16130

...

  • If you cannot find an example of an existing logic that uses a chart type that you intend to use, it should be fairly easy to adapt one of the Highcharts Demos. Select your chart and click on the 'View Options' button and you will see the JS source code, including a Highcharts.chart('container', {...}) call. This {...} content is the definition map. You will have to convert it from JS to Groovy. This always implies replacing the curly brackets by square brackets ({} -> []). But you may also sometimes encounter code like Highcharts.color(colors[5]).brighten(0.2).get() which you should replace by your own hard coded colors, or formatter: function () {...} which you would have to replace by a simpler pattern formatter format: '{point.name}: {point.y:.1f}%'.

  • If you want to remove the The “Highcharts.com” watermark and link from are not displayed by default. If you want to have them displayed in the chart, use the credits property in your definition:

    Code Block
    languagenone
    def chartDef = [
    	chart: [ type: 'column' ],
    		credits: [
    				enabled: false true,
    				text: "highchart.com"
    			],
    
    		title: [
    			text: 'My Chart'
    		],
  • If you have a pie chart in a Quote or Agreement/Promotion custom header, chart data labels may not be displayed due to the header's limited space. To make sure the labels are displayed, you must specify a smaller than the default distance of the labels from the pie chart edge. In the following example, you set the distance to 5 instead of the default 30. The value can also be defined as a percentage of the pie's radius:

    Code Block
    languagenone
    "dataLabels": {
            "enabled": true,
            "format": "<b>{point.name}:</b> {point.y:,.2f} %",
            "style": { "fontWeight": "normal" },
            "distance": 5
          },

...