• Resolved meenimee

    (@meenimee)


    Hi,

    I have added some pie charts that I have created on my page but it is giving me crazy white space around the charts. Is there a setting or some css that I can use to change this?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author wpDataTables

    (@wpdatatables)

    Hello meenimee.

    This is the default behavior of Google Charts engine, unfortunately, so there’s no CSS or settings we can change to make it look better.

    However, there are wpDataChart callbacks which can make it look better. Here is one example:

    <script type="text/javascript">
    jQuery(window).on('load', function(){
    if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; }
    wpDataChartsCallbacks[1] = function(obj){
    obj.options.chartArea = {'width': '80%', 'height': '95%'};
    }
    });
    </script>

    This will be insert on page where you insert that chart. Also you will replace 1 in wpDataChartsCallbacks[1] with id of your chart.

    A lot of different customization you can find here and on other resources on the web, but you will need to adjust it in wpDataChart callbacks.

    Every chart exposes several options that customize its look and feel. Charts usually support custom options appropriate to that visualization. wpDataChart callbacks allow adding options that are available in Google Charts API. (you can take a look at examples for each engine in our documentation, and also in Support help center).

    Please note that using hooks or wpdatatable and wpDataChart callbacks requires certain level of programming skills and included support refers only to advice.

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘White space/padding around charts’ is closed to new replies.