• Hi,
    I need to know if is it possible add more than one ID in the color function, thank you so much:

    add_action( ‘woocommerce_register_form_start’, ‘wooc_extra_register_fields’ );

    function easy_charts_get_chart_configurations_callback( $ec_chart_option, $chart_id, $meta_key ){

    if( $chart_id == 3706 && $meta_key == ‘graph’ ){

    $ec_chart_option[‘custompalette’] = array(
    ‘#4eafe4’,
    ‘#d17ba8’,
    ‘#dedede’,
    ‘#0a0a0a’,
    );

    }

    return $ec_chart_option;
    }

    add_filter( ‘easy_charts_get_chart_configurations’, ‘easy_charts_get_chart_configurations_callback’, 10, 3 );

Viewing 2 replies - 1 through 2 (of 2 total)
  • function easy_charts_get_chart_configurations_callback( $ec_chart_option, $chart_id, $meta_key  ){
    
    	if( $chart_id == 123 && $meta_key == 'graph' ){
    
    		$ec_chart_option['custompalette'] = array(
    				'#000000',
    				'rgba(0,0,0,0.6)',
    				'#dedede',
    				'#0a0a0a',
    		);
    
    	}
    
    	return $ec_chart_option;
    }
    
    add_filter( 'easy_charts_get_chart_configurations', 'easy_charts_get_chart_configurations_callback', 10, 3 );

    Im using that and want multiple colors, but i think the plugin is unsupported now

    Plugin Author Kiran Potphode

    (@kiranpotphode)

    Hi @pixelcreativeit ,

    Its possible to add the multiple ids in PHP code snippet.

    if( $chart_id == 1 && $chart_id == 2 && $meta_key == ‘graph’ ){

    From above code line you can see multiple id’s can be provided with conjunction of && PHP operator.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘same custpm color for multiple ID charts’ is closed to new replies.