Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How come the div containing the Flot graph returns empty on an ajax callback from my form. I attach an ajax callback on my radio elements to retrieve a new set of data depending on the radio chosen.
Comments
Comment #1
Bimble CreditAttribution: Bimble commentedI have the same problem, did you find a solution?
Comment #2
Etroid CreditAttribution: Etroid commentedThis is an old issue, but I thought I'd give my two cents after encountering this issue myself. By default the javascript to plot the chart does not get run on ajax callback. In order to achieve this you have to write some custom code. I ended up writing my own custom flot chart function which is using "Drupal.behaviors" and runs on ajax callbacks as well. The code below requires some modifications of the flot module, but it should give you an idea of how to go about it. You are always welcome to pm for more information.
Hope this will help someone out in the future!
The JS code:
--------------
Php code
----------