Amanda Sackett
Amanda Sackett

Reputation: 1

Highcharts- Creating a dynamic x-axis to maintain bar spacing with less data points but maintain x-axis "width"

I'm looking for a solution to add to my clientscript in actuate opentext studio. In the first image I have the columns of the grid lining up with the table bars; this is for a 28 day period. I need a similar display when having less data points- basically maintaining the same column spacing pattern in the graph given less data points. Currently the second image shows what happens when I use a parameter of 14 days instead of 28 days. The grid is fine, but I need it to line of similarly to the first example.

Example 1: Correct Line up of Grid and Chart

Example 2: Incorrect widening of the spacing in Chart

Upvotes: 0

Views: 268

Answers (1)

Amanda Sackett
Amanda Sackett

Reputation: 1

Figured it out. Thanks @ppotaczek. Your comment put me on the right track! Very new to this but that helped a lot. It sets the "empty" values as having a 'null' label instead of being empty/blank so that's something I'll have to workout but thanks!

Below code will set your bar widths, and return blank values/max set around your parameters. My max was 28 so I subtracted by one to get the correct output.

beforeGeneration: function(options)

{ options.xAxis.max = 27

//You can change options here. options.plotOptions = { series: {

pointWidth: 25, //size of column pointPadding: 0.25, //size of

padding between each bar groupPadding: 0 //padding between each

value groups in x axis } }; },

Upvotes: 0

Related Questions