jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

annotation options update dynamically

how can i update default annotation options after chart is created.. i do have

Code: Select all

navigation: {
				bindingsClassName: 'tools-container', // informs Stock Tools where to look for HTML elements for adding technical indicators, annotations etc.
				annotationsOptions:{
					events:{
						add:function (){
							console.log('in the add annotation event');
							let chart = this.chart;
							console.log('here is hte char,,',chart.annotations);
						},
						afterUpdate:function(){
							//we cant use this since this one gets fired too  many times.
							//instead we need custom dialog to edit and then save/update
							//console.log('here in the update chart...need to save this in database..',this.chart.annotations);
						},
						remove:function(){
							console.log('here in the remove annotation event,.');
						}
					},
					typeOptions: {
						line: {
							stroke: <user defined>
							strokeWidth: chartOptions.annLineWidth
						},
					},
initially when i create charts and its working fine, but we do have requirement.. that user can change defaults even after drawing annotation in which case i have to update all annotations with new options. and future annotations will be use <new> sets of defaults.. how can i do that ?

Thanks
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: annotation options update dynamically

Hi,
Thanks for your message.

In the beginning, I recreated your demo, that we can work on it.

Could you check the demo and explain in more details what do you want to achieve?
https://jsfiddle.net/BlackLabel/z4epnso3/

Your code point on navigation, I'm not sure why, do you want to change exporting buttons?
https://api.highcharts.com/highstock/navigation
A collection of options for buttons and menus appearing in the exporting module.
Maybe you are looking annotations.events?
https://api.highcharts.com/highstock/annotations.events

I'm waiting for news from you.
Best regards.
Sebastian Hajdus
Highcharts Developer
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: annotation options update dynamically

I am sorry for confusion.. i was able to fix some of my issues.. i do have custom popup for editing annotations. and i would like to un-select the annotation after user presses Save button.. (custom) .. how can i do that ?

like in below demo

https://jsfiddle.net/wsce48uk/

select annotation then you will see popup.. click the save button.. popup will get closed. but annotation is still selected.. how can i un-select that ?
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: annotation options update dynamically

Hi,

The answer is in another topic, please do not repeat the same question in different topics.
viewtopic.php?f=12&t=47467&p=170971#p171014

Best regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Stock”