Changing Value Label's Font Size, Weight And Rotation
Updated 07-22-2024
SiftHealthcare Thank you for clarifying that! To ensure all data labels are shown, you can use the script below to dynamically set the y-axis maximum value. Set the variable percentToAdd to the percentage of the maximum value to add to the y-axis, e.g. if the maximum value in the chart is 100, setting the percentToAdd variable to 10 will change the y-axis max value to 110.
Let me know if this works for you.
/*** This script is for increasing the y-axis max value by adding a percent of the maximum value from the series to the y-axis. ***/
//Set the offset percent to add to the y-axis max value here
var percentToAdd = 10;
widget.on('processresult', function(se,ev){
var seriesData = ev.result.series[0].data;
var numOfDataPoints = seriesData.length;
var dataPoints = [];
for(i=0; i < numOfDataPoints; i++) {
dataPoints.push(seriesData[i].y)
}
var maxValue = Math.max.apply(Math, dataPoints);
ev.result.yAxis[0].max = maxValue * (1 + percentToAdd/100);
})