Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kiran Potphode

    (@kiranpotphode)

    Hi mauro269,

    Currently, the plugin doesn’t support custom colors at the time of chart creation. So many users are asking for this feature so I might add this in future.

    Till then you can add custom color to your chart by adding following code snippet to your theme’s functions.php file.

    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 );

    Note that chart_id (123 in above example ) is the id of your chart you wish to modify. You can provide any number of colors in Hex or RGBA format.

    Please free to ask any doubt about this code sniffet. I am happy to help.

    Thank you

    Hi @kiranpotphode,

    In the dropdown for palette, I dont have custom to chose from, is that a feature that recently has been removed? I only have default, plain, android, simple, soft, egypt, olive, candid, sulphide and lint. I have tried to edit one of the existing eg defualt with the code below, but nothing changes. Eg $ec_chart_option[‘defaultpalette’] = array(

    Please help! ??

    Plugin Author Kiran Potphode

    (@kiranpotphode)

    Hi @96320-1,

    There is no need to choose any options from the dropdown for palette if you are achieving this by placing php code.

    You have to just follow the example from above reply.

    If you need any further help for that, I am happy to help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Any news about custom colors for every chart?’ is closed to new replies.