searchBuilder plus highCharts - chart not updating after search
searchBuilder plus highCharts - chart not updating after search
cj1005
Posts: 143Questions: 46Answers: 1
Hi,
I've set up my web page to use SearchBuilder and HighCharts plug-in's which are working but after I do a search using the searchBuilder, the chart does not update as expected. I would expect the code below to detect the table draw and update the chart but it is never called, although the datatable updates accordingly.
dtRepotable.on('draw', function () {
console.log("Redrawing chart")
repoChart.series[0].setData(chartData(dtRepotable));
});
Any suggestions, please?
Thanks, Chris
This question has an accepted answers - jump to answer
Answers
Looks like updates to the Search Builder filters call
draw()
in this example:http://live.datatables.net/buvejura/1/edit
Please update the example or provide a link to your page so we can help debug.
Kevin
Hi Kevin,
Apologies, you are right, but in my example below, when I do a search on the 'Despatch By' date (using the between condition) it does not update the chart and subsequent searches no longer work (hence my misunderstanding above), but they do update the chart prior to doing the date search.
https://www.wd4g.com/WCGateway/WDLogin.wc
UN: DTUSERS
PS: DTUSER
Thank you for looking at my problem.
Cheers, Chris
If it helps, in my few tests it seems to the 'between' and 'NOT between' conditions that stop the chart from updating & I have to reload the page to get the chart working again.
Cheers, Chris
I tried your test case but it seems to be working when trying Search Builder with the
Dispatch By
column. Please provide the exact steps to show the problem.Kevin
Hi Kevin,
When I first load the screen the pie chart shows the breakdown for all jobs, but when I do a search between two dates {15/06/21} to {22/06/21} the pie chart does not update and it still shows the breakdown for all jobs also any subsequent searches no longer update the chart either until I reload the page.
Cheers, Chris
I'm guessing you need to trigger a pie chart draw on a
draw
of the DataTable, to ensure they're in step.Colin
Hi Colin,
Thanks for your suggestion, the issue is the datatable draw is not being called in the instance above so I'm not sure how I would force a chart draw without that.
Bear in mind, it appears to only happen when I use the 'Between' and 'Not Between' conditions, all the other conditions work as expected.
Thanks, Chris
Hi Chris,
I'm seeing
draw
being triggered in this example here. There are several issues there though - events are being triggered unnecessarily, but there is an event when the dates are fully triggered, so I would've thought that would be enough to get the data to the pie-chart.I've raised a ticket internally for the spurious events (DD-2001 for my reference) and we'll report back here when there's an update.
Cheers,
Colin
Thank you Colin
I just wanted to update this thread to say my issue is now resolved. I switched to the js and css nightly rebuilds for 'datetime' and 'seachBuilder' (see Colin's example above) and this corrected my issue.
Thanks Colin
Ah, sorry about that, I forgot to update this thread when the issue was addressed. It was fixed on Friday last week and closed, so yep, that's good to go,
Colin