Redrawing Chart after first load
Redrawing Chart after first load
Hi. I'm trying to link Highcharts to Datatable, but I can't redraw the chart whenever I attempt a search.
Here is the fiddle: https://jsfiddle.net/8qrojfoz/7/
I think it has to do with using initComplete and filling the chart from the JSON and not the rendered data, right? However, whenever I move this function out of initComplete, the returned arrays always come empty.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Here is an updated fiddle:
https://jsfiddle.net/qkff4a4a/
I made 4 or 5 changes and commented them, I think
. Here are the highlights:
initComplete passes
$('#mytable').DataTable()for the table variable to setTableEvents()$('#mytable').DataTable()in place oftableand usesselector-modifierto filter the rows based on the searchvar data = $('#mytable').DataTable().rows({search: 'applied'}).data();Now it seems to behave as desired. At least it updates the chart appropriately.
Kevin
Have you really updated the fiddle? I'm still seeing mine :'(
Sorry, forgot to "update" (I'm used to the auto save of live.datatables.net
https://jsfiddle.net/qkff4a4a/2/
Kevin
I'm flabbergasted, my friend. This works like a charm and seems to be very efficient. Thank you so, so much!