Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi,

    I’m trying to create a chart from some data in a database.
    I toke a look to this post: https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-chart-series-and-data-dynamically%3F

    and before try it with a concrete database I have the following code:

    <?php

    add_filter( ‘mycustom_series_filter’, ‘myplugin_filter_chart_series’, 10, 3 );
    function myplugin_filter_chart_series( $series, $chart_id, $type ) {
    $series = array(
    // the first series
    array(
    ‘label’ => ‘The name’, // the label of the series
    ‘type’ => ‘string’, // the type of the series
    )
    );
    return $series;
    }

    add_filter( ‘mycustom_data_filter’, ‘myplugin_filter_chart_data’, 10, 3 );
    function myplugin_filter_chart_data( $data, $chart_id, $type ) {
    $data = array(
    // the first row of data
    array(
    ‘Something’, // the value of the first series
    165, // the value of the second series
    32, // the value of the third series
    )
    );
    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
    return $data;
    }

    ?>

    [visualizer id=”17″ series=”mycustom_series_filter” data=”mycustom_data_filter”]

    The problem is that nothing happens. I think that I need to configure somehow the visualizer with id 17 to receive the data, but I cannot find an example showing how. Not even a complete working example to follow.

    Can you please help me?

    Thank You

Viewing 1 replies (of 1 total)