Once upon a time, there was a chart...
This chart had multiple series stacked on top of itself in columns, but then a line was placed on top of the stacked columns to represent the sum of the impish little boxes below. The King of HighCharts needed this line to extend all the way to the edges and could not find the proper setting to do so.
The elders decided on the plotOptions to be defined as such:
plotOptions: {
column: {
animation: false,
stacking: 'normal',
pointWidth: 19
},
line: {
marker: { enabled: false },
step: 'center',
color: '#0a4d85'
},
series: {
states: { hover: { enabled: false } },
}
}
The court jester finds this problem to be really funny, but runs the risk of losing his head if he doesn't come up with the right answer...and soon.
Each data series matches up perfectly [0 - 48].
Suggestions and solutions that save the jester will be met with a great kingly check mark.
SOLVED! JESTER LIVES!!!
The padding of the data series suggested by @jlbriggs was a success. Defining the limits of the x-axis trimmed off any excess data points with ease.
There isn't a single setting that will do this. The points are, by default, aligned in the center of the category. You could set your tickmarkPlacement
property from the default of between to on, but this will mess up your column grid.
The best option that I am aware of for this particular scenario is to fake it, by adding a data point to both the beginning and end of your line, at -0.5 of your min x value, and + 0.5 of max x value, respectively, repeating your first and last y value.
So, for example, if your data is:
data: [3,4,7,8,6,5,4,5,4,3,4]
It would then need to be:
data: [{x:-0.5, y: 3},3,4,7,8,6,5,4,5,4,3,4,{x:10.5, y: 4}]
You may need to adjust a few other options as well, depending on your other chart options, such as:
x axis min/max
plotOptions -> column -> grouping: false
plotOptions -> column -> pointRange: 1
Example:
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments