First is in this example: https://stackblitz.com/edit/highcharts- ... mponent.ts
When I click on the flag button in the stockTools gui then set flag in the diagram and enter the title/name of the flag. How can I get these values (flag title, name) later?
I think something like this :
Code: Select all
flags[0].getTitle()
Second question is that how can I set flags with click event without stockTools gui? Example I choose value with select option in html and set flag with click event which title is option value.
Code: Select all
series: [
{
type: "line",
data: [1, 2, 3, 4, 5],
point: {
events: {
click: (function(component) {
return function() {
let point = this;
let x = point.x;
let y = point.y;
if (component.option == "a") {
// if I choose 'a' option I would like to set flag with 'a' title on diagram
} else if (component.option == "b") {
// if I choose 'b' option I would like to set flag with 'b' title on diagram
}
};
})(this)
}
}
}
]