data from wordpress filter

This feature gives you the option of getting the dynamic data from wordpress add_filter ‘graphina_extra_data_option

add this graphina filter in any wordpress file , for example -> activate theme -> functions.php file  

Example :

//$data -> sample data
//$type -> type of widget (line, area)
//$settings -> elementor setting array
//$widgetId -> Id of elementor widget ( each widgets have unique id)

add_filter(‘graphina_extra_data_option’,function($data, $type, $settings,$widgetId){
          if($type == ‘pie’ || $type == ‘donut’ || $type == ‘radial’ || $type == ‘polar’ ){
                 return [
                        ‘series’ => [52, 62 ,48,52 ],
                        ‘category’ =>  [ “Jan”, “Feb”, “Mar”,  “Apr” ],
                        ‘total’=>542
                   ];
            }
            if($type == ‘area’ || $type == ‘column’ || $type == ‘brush’ || $type == ‘mixed’ || $type == ‘line’ || $type == ‘radar’ || $type == ‘distrubuted_column’){
                    return [ ‘series’ => [
                           [
                            ‘name’ => ‘elem’,
                            ‘data’ => [ 52,58,585,14]
                           ]
                     ],
                     ‘category’ => [ 25, 27, 28,  29 ]
                     ];
              }
             if($type === ‘data_table_lite’ || $type == ‘advance-datatable’){
                    return [
                        ‘body’ => [
                            [‘abc’ ,’xyz’],
                            [‘rtl’ ,’yzr’]
                        ],
                        ‘header’ => [‘firstname’,’lastname’]
                    ];
             }

            if($type == ‘counter’){
                   return [ [‘title’ => ‘filter’,
                       ‘speed’ => 1200,
                       ‘start’ => 0,
                       ‘end’ => 8025,
                       ‘multi’ => []
                   ]];
             }

  }, $priority, $accepted_args);
 

How to get data from wordpress filter