javascript - amStock Charts Multiple Datasets: Get names of all the Dataset selected for comparing -


i want load multiple datasets using json in datasetcompared event. need update datasets selected comparison in datasetcompared event.

i don't find documentation anywhere list(array) of selected datasets comparing in datasetcompared event of chart. amcharts internally in many examples unable figure out how understands datasets load.

does have idea how list of selected datasets comparing in datasetcompared event?

you can use chart's property maindataset find reference main selected data set, , compareddatasets list of references data sets selected comparison.

now, if using in datasetcompared event, might need delay actions related bit. compareddatasets array updated after event triggered.

i.e.:

chart.datasetselector.addlistener( "datasetcompared", function( event ) {   settimeout(function() {     ( var = 0; < event.chart.compareddatasets.length; i++ ) {       console.log( event.chart.compareddatasets[ ].title );     }   }, 10); } ); 

updated fiddle.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -