I understand it defaults to
Code: Select all
format: {value},
I am trying to customise it such that it would show, in normal font-size: name, then in a smaller font-size: amount of days.
I belive, to calculate the amount of days betwen start and end, we should use something as such:
Code: Select all
labels: {
formatter: function() {
var point = this.point,
days = (1000 * 60 * 60 * 24),
number = (point.end - point.start) / days;
return Math.round(number * 100) / 100;
}
}
However, I can't get this to work on the 'treegrid' yAxis type? And how to - before these number of days - also print the data point's name please?
Trying to make it one step easier, I can't even very well understand how to output anything else other than the name (see this.value below) or any standard fixed text (see 'abc' below). That is: somehow I can't use anything such as optionaltext.
Code: Select all
yAxis: {
labels: {
format: '{value}',
formatter: function () {
var point = this,
optionaltext = this.optionaltext || ''
return this.value + optionaltext.value + 'abc';
},
},
},
Code: Select all
{
start: Date.UTC(2021, 00, 10),
importantmilestone: Date.UTC(2021, 00, 14),
end: Date.UTC(2021, 00, 16),
name: 'The name of a data point',
parent: 'The name of the parent',
optionaltext: 'Some optional text',
y: 0,
},