Title: Populate series data dynamically
Last modified: February 21, 2021

---

# Populate series data dynamically

 *  Resolved [manasluminary](https://wordpress.org/support/users/manasluminary/)
 * (@manasluminary)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/populate-series-data-dynamically/)
 * Hello,
 * I am trying to follow the recommendations from below link to populate the data
   in the output.
    [https://docs.themeisle.com/article/605-how-can-i-populate-chart-series-and-data-dynamically](https://docs.themeisle.com/article/605-how-can-i-populate-chart-series-and-data-dynamically)
 * What I have done so far is,
    1) created a chart and use the short code <?php 
   echo do_shortcode( ‘[visualizer id= 9242 series=”mycustom_series_filter” data
   =”mycustom_data_filter” settings=”mycustom_filter_settings”]’ ); ?> 2) Added 
   code in the theme;s function.php to see if the code gets called . I have added.
 * However I do not see any effect on the graph. Is it possible that I have missed
   something in my code ?
 *     ```
       // filter for chart
       add_filter( 'mycustom_series_filter', 'myplugin_filter_chart_series', 10, 3 );
       function myplugin_filter_chart_series( $series, $chart_id, $type ) {
           // do your stuff here
           echo "Hello world";
       	$series = array("Volvo", "BMW", "Toyota");
           return $series;
       }
   
       add_filter( 'mycustom_data_filter', 'myplugin_filter_chart_data', 10, 3 );
       function myplugin_filter_chart_data( $data, $chart_id, $type ) {
           // do your stuff here
           echo "Hello world";
           return $data;
       }
   
       add_filter( 'mycustom_filter_settings', 'myplugin_filter_chart_settings', 10, 3 );
       function myplugin_filter_chart_settings( $data, $chart_id, $type ) {
           // do your stuff here
           echo "Hello world";
           return $data;
       }
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpopulate-series-data-dynamically%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Vytis](https://wordpress.org/support/users/bvytis/)
 * (@bvytis)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/populate-series-data-dynamically/#post-14114048)
 * Hi [@manasluminary](https://wordpress.org/support/users/manasluminary/),
 * We apologize for the confusion and that our documentation was not updated.
    We
   have removed these arguments from the shortcode some time ago.
 * Please refer to this thread for more information:
    [https://wordpress.org/support/topic/graphs-from-shortcodes-and-filters-not-dynamic-should-be/](https://wordpress.org/support/topic/graphs-from-shortcodes-and-filters-not-dynamic-should-be/)
 * We have now updated the documentation and removed the examples that are no longer
   working.
 *  Thread Starter [manasluminary](https://wordpress.org/support/users/manasluminary/)
 * (@manasluminary)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/populate-series-data-dynamically/#post-14145192)
 * Thank you so much for fixing the documentation. It worked. Now I am trying to
   print the shortcode in my function.php
 * The set up I have now is that I call an ajax function and it returns the HTML
   as below and I set this to the HTML.
 * However when I look at the inspect mode, I see
 * <div id=”visualizer-9242-887479811″ class=”visualizer-front visualizer-front-
   9242″></div>
 * <!– Not showing structured data for chart 9242 because title is empty –>
 * Is there any limitation around shortcode which can make this happen ?
 * [https://luminaryproperties.co.uk/check-average-rent-in-a-postcode/](https://luminaryproperties.co.uk/check-average-rent-in-a-postcode/)
 *     ```
       var data = {	
       			          'action': 'hmorent_data',
       			          'postcode': postcode,
       			        };
       			        jQuery.post(ajaxurl, data, function(response) {
       			            if(response != ''){
       			                jQuery('.ajaxpostresponce_hmo').html(response);
       			            }else{
       			                jQuery('.ajaxpostresponce_hmo').html("No Results Found");
       			            }
       			        }).fail(function(xhr, status, error) {
       			            console.log(status);
       			            console.log(error);
       			        });
       ```
   
 *     ```
       function hmorent_data()
       {
   
           $postcode = $_POST['postcode'];
       	$_SESSION["hmorentdata_postcode"] = $postcode ;   
       	echo "<div class='mortgage'><label>Monthly Mortgage Payment(£):</label>" . round($mortgage, 2) . "</div>";
       	//echo do_shortcode( '[contact-form-7 id="91" title="quote"]' );
       	echo do_shortcode( '[visualizer id= 9242 title="HMO Rent"]' );  
           exit();
       }
       ```
   
 *  Plugin Support [Vytis](https://wordpress.org/support/users/bvytis/)
 * (@bvytis)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/populate-series-data-dynamically/#post-14187091)
 * [@manasluminary](https://wordpress.org/support/users/manasluminary/),
 * We do have a feature request to make Visualizer work with AJAX, however, we do
   not have this implemented yet so at least for now we do not have a method to 
   refresh and reload charts properly (based on the tests that I made).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Populate series data dynamically’ is closed to new replies.

 * ![](https://ps.w.org/visualizer/assets/icon-256x256.gif?rev=3084574)
 * [Visualizer: Tables and Charts Manager for WordPress](https://wordpress.org/plugins/visualizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/visualizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/visualizer/)
 * [Active Topics](https://wordpress.org/support/plugin/visualizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/visualizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/visualizer/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Vytis](https://wordpress.org/support/users/bvytis/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/populate-series-data-dynamically/#post-14187091)
 * Status: resolved