Hello, 

I am trying to set a log scale in both hAxis and vAxis when I refresh the 
page (through AJAX). 

I specify 'logScale = 'True' in options but it works for vAxis and not for 
h Axis. All my data are positive without date. 

Here is my code if someone could help me: 

Thanks!
------------------------------------------------
 function drawChart(dataIn) {

            var data = google.visualization.arrayToDataTable(dataIn);

            var options = {
                legend: 'yes',
                pointSize: 10,
                hAxis: {
                    logScale:true,
                    scaleType:'log',
                    gridlines: { count: 10 },
                    title: varX2.options[varX2.selectedIndex].text
                    
                },
                vAxis:{
                    logScale: true,
                    title: varY2.options[varY2.selectedIndex].text
                },
                series: {
                    0: { pointShape: 'circle' },
                    1: { pointShape: 'triangle' },
                    2: { pointShape: 'square' },
                    3: { pointShape: 'diamond' },
                    4: { pointShape: 'star' },
                    5: { pointShape: 'polygon' }
                }

            };

            var chart = new 
google.visualization.ScatterChart(document.getElementById('chart_div2'));

            chart.draw(data, options);
        }

    $(document).ready(function() {

            $('#button2').click(function() {
                $.ajax({
                    url: 'data_json.php',
                    type: 'POST', 
                    data:{varX2:$('#varX2').val(), varY2:$('#varY2').val() 
},
                    success: function(json) {
                        json = JSON.parse( json );                     
                        console.log( json ); 
                        google.setOnLoadCallback(drawChart(json));
                    }
                });
            });
    });

------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/440a2238-7113-45ef-943c-27547a36a325%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to