Okay
  Public Ticket #1012837
Google Gauge Chart
Closed

Comments

  •  2
    drcolin started the conversation

    Hi

    I have added this code but it doesn't seem to be working and can't understand why.  Can you help?

    var wpDataChartsCallbacks = { 1: function(obj){  obj.options.yellowFrom = 0; obj.options.yellowTo = 5; obj.options.greenFrom = 5; obj.options.greenTo = 10; obj.options.redFrom = 10; obj.options.redTo = 20; obj.options.max = 500; } };

  •  2
    drcolin replied

    Actually I can get it working for chart with the ID of 2 but when I copy the code and change the ID to further customize the others then it doesn't work for those. Not sure what I'm doing wrong.

  • [deleted] replied

    Hi drcolin,
    Thank you for your purchase.

    Please send me your login credentials and page where you are trying to achieve this (One which have Gauge Chart). You can write your credentials here just check PRIVATE so nobody can see it except us. 

  •   drcolin replied privately
  • [deleted] replied

    Hi drcolin,

    Google Gauge chart that you have created is not created well. You have added just one column that will be used in chart Total Requests but reference to the documentation Google Gauge chart requires two columns:

    One string or date column supported (will be used to name the gauges)
    Other columns should have numerical values.
    2 columns strictly required.
    It’s better not to have many rows.

    You should add one more column display_name to your Gauge chart is created as it should.

     Also I noticed that table 11 from that you created chart is empty. There is no data in it so chart can't be also created without data. You will add some data in that table?

  •  2
    drcolin replied

    Thank you Milos.

    I have added the other column which displays the name.  The table isn't empty however.  It is performing the way it should as it's only displaying the values for the current user.  Displays the correct number on the frontend of the site.

    However I can't figure out how to change the max and colour options on the chart with the following code.   Am I missing something?  I want to change Chart ID 4 with the following

    if( typeof wpDataChartsCallbacks == 'undefined' ){ 
    wpDataChartsCallbacks = {}; } 
    wpDataChartsCallbacks[4] = function(obj){ 

            obj.options.redFrom = 0;
            obj.options.redTo = 30; 
            obj.options.max = 30; 
        }
    }


  • [deleted] replied

    Hi drcolin,

    You can try something like this:

    jQuery(window).load(function(){ 
        if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; } 
    wpDataChartsCallbacks[3] = function(obj){ 
            obj.options.min = -8; 
            obj.options.max = 8; 
            obj.options.greenFrom = 1.5; 
            obj.options.greenTo = 8; 
            obj.options.yellowFrom = -2.5; 
            obj.options.yellowTo = 1.5; 
            obj.options.redFrom = -8; 
            obj.options.redTo = -2.5; 
        }
    });

    This is just an example. You can modify it by your needs.

  •  2
    drcolin replied

    Perfect!  Worked like a charm. Thanks Milos!

  • [deleted] replied

    Hi drcolin,

    You are welcome. We'd greatly appreciate it if you could take a minute and leave a review on CodeCanyon on this link. Thanks!