thank you asgallant. actually, i want to put the month in the x axis, not 
the date.  i try to hide the day information by using date format. but it 
is still strange. in the x axis, there are many points of the same month (i 
just want one month to show once). here are my code and results.

function drawChart() {
    var dates = [
        [new Date(Date.parse('05/03/2013')),3],
        [new Date(Date.parse('06/03/2013')),6]
       
    ];
    var data = new google.visualization.DataTable();
    data.addColumn('date', 'month');
    data.addColumn('number', 'results');
    
    
    for(var i = 0; i < dates.length; i++) {
        var dt = dates[i];
        var date = new Date(dt[0].getFullYear(), dt[0].getMonth());
      
         data.addRow([date, i+dt[1]]);   
    }; 
    
    // Format data
    var dateFormat = new google.visualization.DateFormat({pattern: 
'yyyy-MM'});
    dateFormat.format(data, 0);
    
    // Create and draw the visualization.
    var chart = new 
google.visualization.ScatterChart(document.getElementById('chart_div')); 
    var options = {
      
    
        hAxis: {
            title: 'month',
            format: 'yyyy-MM'
        },
        vAxis: {
            title: 'results',
         
        }
    };
    chart.draw(data, options);
}
google.setOnLoadCallback(drawChart);
google.load('visualization', '1', {packages:['corechart']});





On Wednesday, October 9, 2013 2:11:29 PM UTC+2, asgallant wrote:
>
> Yes, you can use dates.  You must enter them as javascript Date objects, 
> though, not as strings.
>
> On Wednesday, October 9, 2013 5:34:52 AM UTC-4, min ji wrote:
>>
>> hello everybody,
>> i want to draw a scatter chart. but my data of x axis is date. is there 
>> some ways that i can draw scatter with date?
>> thank you
>>
>

-- 
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

<<attachment: results.jpg>>

Reply via email to