Advanced chart configuration overrides

1 post / 0 new
Anders
Anders's picture
Advanced chart configuration overrides

Most charts and gauges in AnalyzePRO is built on Highcharts chart library.

In addition to dialog settings and advanced algorithms inside the AnalyzePRO there can be situations where you find yourself caught in a situation where you just need to hard-code a setting inside the chart API.

From AnalyzePRO version 5.3.1 we provide a "hard-core" override system based on highchart's own API object structure: http://api.highcharts.com

This override system is a array of configuration-overrides named $.runtimeProxy.chartOverrides.
Overrides need to be defined for each container that you want to override.

Below you will find a example where I want to force the yAxis.tickInterval to 1 for the container named hcContainer_elContainer_5.
To solve this add these lines to the lower script input area in Dashboard Properties:

$.runtimeProxy.hcOverrides = [

  {

    hcContId: "hcContainer_elContainer_5",

    override: {

      yAxis: [{

        tickInterval: 1 

      }]

    }

  }

];
 
 

Exampe

Rotate values on the bar chart 90 degrees. Remember to assign the code to the correct elContainer ID (in the example it is elContainer_8). If you allready got $(document).ready in you script, you only need the code for the override.
 
$(document).ready(function(){
  
$.runtimeProxy.hcOverrides = [
  {
    hcContId: "hcContainer_elContainer_8",
    override: {
    plotOptions: {  
      series: {
            dataLabels: {
                enabled: true,
                align: 'left',
                color: '#ff0000',
                x: 2,
                y:-10,
                rotation:270,
                style: {
                  fontWeight: 'bold',
                  color: '#000'
                }
            }
        }
    }   
    }
  }
];

});
 
To find out which properties to set, refer to http://api.highcharts.com for the given version or debug running code if debugmode is true.
 
Happy coding!