Hi,

I am trying to parse datetime to dd/mm/yyyy format but its currently outputting the date values in x-axis of the graph in 'NaN Nan'.

Code:
     function drawVisualization(dataValues, chartTitle, columnNames, categoryCaption) {
            if (dataValues.length < 1)
                return;

            var data = new google.visualization.DataTable();
            data.addColumn('string', columnNames.split(',')[0]);
            data.addColumn('number', columnNames.split(',')[1]);
            data.addColumn('string', columnNames.split(',')[2]);
            data.addColumn('datetime', columnNames.split(',')[3]);

            for (var i = 0; i < dataValues.length; i++) {

                var date = new Date(parseInt(dataValues[i].Date.substr(6), 10)); // error (NanNan)
 
                data.addRow([dataValues[i].ColumnName, dataValues[i].Value, dataValues[i].Type, dataValues[i].Date]);
            }

            var dateFormatter = new google.visualization.DateFormat({ pattern: 'dd MM yyyy' });
            var line = new google.visualization.ChartWrapper({
                'chartType': 'LineChart',
                'containerId': 'PieChartContainer',
                'options': {
                    'width': 950,
                    'height': 450,
                    'legend': 'right',
                    'hAxis': {
                        'format': "dd-MM-yyyy",
                        'hAxis.maxValue': 'viewWindow.max',
                        'maxValue': new Date(2014, 05, 30), 'minValue': new Date(2014, 04, 05),
                        'viewWindow': { 'max': new Date(2014, 05, 30) },
                    },
                    'title': chartTitle,
                    'chartArea': { 'left': 100, 'top': 100, 'right': 0, 'bottom': 100 },
                    'tooltip': { isHtml: true }
                },
                'view': {
                    'columns': [{

                        type: 'string',
                        label: data.getColumnLabel(3),
                        calc: function (dt, row) {
                            var date = new Date(parseInt(dt.getValue(row, 3)));
                            return dateFormatter.formatValue(date);
                        }
                    }, 1, {
                        type: 'string',
                        role: 'tooltip',
                        calc: function (dt, row) {
                            return 'Name: ' + dt.getValue(row, 0) + ', Decimal Price: ' + +dt.getValue(row, 1) + ', Date: ' + +dt.getFormattedValue(row, 3);
                        }
                    }]
                }
            });
The line chart has a inner function which converts the dateTime to string (dt) and i was advice to use that. I am little unclear how can use that in the ParseInt code? I have tried it, but it throws a reference error:

ReferenceError: dt is not defined --> error

Code:
     for (var i = 0; i < dataValues.length; i++) {

                var date = new Date(parseInt(dt.getValue(row, 3))); // reference error 

                data.addRow([dataValues[i].ColumnName, dataValues[i].Value, dataValues[i].Type, dataValues[i].Date]);
            }
dateformat function

Code:
'view': {
                    'columns': [{

                        type: 'string',
                        label: data.getColumnLabel(3),
                        calc: function (dt, row) {
                            var date = new Date(parseInt(dt.getValue(row, 3)));
                            return dateFormatter.formatValue(date);
                        }
                    }, 1, {
                        type: 'string',
                        role: 'tooltip',
                        calc: function (dt, row) {
                            return 'Name: ' + dt.getValue(row, 0) + ', Decimal Price: ' + +dt.getValue(row, 1) + ', Date: ' + +dt.getFormattedValue(row, 3);
                        }
                    }]
                }
Please advice, if possible. Thank you in advance for your help.