Has anyone able to get a chart working from the database?
-
I have tried exporting data to a .csv file and it works. If I try the exact same data by returning it as an array in the filter, as documented here How-can-I-populate-chart-series-and-data-dynamically, I get a blank chart.
I am using
add_filter( 'visualizer-get-chart-data', 'xyz_filter_hist_chart_data', 10, 3 ); function xyz_filter_hist_chart_data( $data, $chart_id, $type ) { // do your stuff here global $wpdb; $sql = "SELECT date, store1, store2, store3, store4, store5 FROM wp_pricehist ORDER BY date ASC"; // $data = $wpdb->get_results( $sql, ARRAY_A ); $data = $wpdb->get_results( $sql, ARRAY_N ); return $data; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Has anyone able to get a chart working from the database?’ is closed to new replies.