It is completely up to you on which event you are going to remove the point. You can remove it on a chart.events.load (to remove it during the chart load), or simply on a button click.
One question here can we dynamically define Y axis, rather than static. I have used below configurations but can we have these categories defined from api
yAxis: {
type: 'category',
categories: ['L 1', 'L 2', 'L 3', 'L 4'],
min: 0,
max: 3,
},
I'm sorry, but I don't really get what you mean by defining an yAxis programmatically. In Gantt chart, the yAxis categories come from your data - more specifically, from series.data.name. In the previous demo I've sent you, you can see how we do not specify an yAxis anywhere, yet it's categories are programmatically created from the names in your data.
If that's not what you meant, please elaborate a bit more on that to help me understand the issue better.
Yes, from API you will get an array of data with 4 items, each containing the specified options (such as name, start, end - and other Highcharts default properties). When it comes to setting the name in your data, if you have in your code a variable called data, which is an array of strings, you can use that in the way you showed me in your post. Highcharts are built using JavaScript, so any JS technique can be used inside them.