my sample code as simple as below:
--------------------------------------------------------------
<script type="text/javascript"
src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div" style="width:200px"></div>
<script>
google.charts.load('current', {'packages':['corechart','line']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var
central_rates={"rows":[{"c":[{"v":"Date(2020,07,24)"},{"v":"23221"}]},{"c":[{"v":"Date(2020,07,23)"},{"v":"23220"}]},],
"cols":[{"type":"datetime","label":"day"},{"type":"number","label":""}]};
var data = new google.visualization.DataTable(central_rates);
var date_long = new
google.visualization.DateFormat({pattern: 'dd/MM'});
date_long.format(data,0);
var options = {
title:'Sample line chart with date label',
titleTextStyle:{fontSize:'0.95em'},
height:'100%',
hAxis: {slantedText:true,format:'dd/MM',},
vAxis: {},
backgroundColor: '#ecf3fe',
legend: 'none',
chartArea:{left:35,backgroundColor:'#ecf3fe',width:'100%'}
};
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
--------------------------------------------------------------
There're 2 point only with date labels as Date(2020,07,24)&
Date(2020,07,23). But the render chart displays them as 24/08 & 23/08
respectively, meaning 1 month was added.
[image: 2020-07-24 15_11_57-chart.html.png]
How can it be? Any advice is appreciated, thanks
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/4a12610d-5aef-4e5d-8f3d-26cf33383e78n%40googlegroups.com.