Hello,
I am having issues getting a date control slider to work correctly. I am
feeding the data in the format of " {"c":[{"v":"2016-01-04 17:05:01"}" but for
some reason the slider draws showing "1970-01-01" I am sure I am missing
something in the parsing of the date (string). If I take the control out, the
chart draws perfectly. Please let me know what I am missing.
// Instantiate and draw our chart, passing in some options.
// Do not forget to check your div ID
var linechart = new
google.visualization.LineChart(document.getElementById('linechart_div'));
linechart.draw(linechartdata, linechart_options);
// We omit "var" so that programmaticSlider is visible to changeRange.
programmaticSlider = new google.visualization.ControlWrapper({
'controlType': 'DateRangeFilter',
'containerId': 'programmatic_control_div',
'options': {
// Filter by the date axis.
'filterColumnIndex': 0,
'ui.format': { 'pattern':'yyyy-MM-dd HH:mm:ss' },
'ui': {
'chartType': 'LineChart',
'chartOptions': {
'chartArea': {'width': '90%'},
'hAxis': {'baselineColor': 'none'}
},
// 1 day in milliseconds = 24 * 60 * 60 * 1000 = 86,400,000
'minRangeSize': 86400000
}
},
// Initial range: 2012-02-09 to 2012-03-20.
'state': {'range': {'start': new Date(2012, 1, 9), 'end': new
Date(2016, 2, 20)}}
});
programmaticChart = new google.visualization.ChartWrapper({
'chartType': 'LineChart',
'containerId': 'linechart_div',
'options': {
is3D: 'true',
width: 1200,
height: 400,
series: {
0: { lineWidth: 2 },
1: { lineWidth: 2 },
2: { lineWidth: 2 },
3: { lineWidth: 4 },
4: { lineDashStyle: [14, 2, 2, 7] },
5: { lineWidth: 2 }
}
}
});
dashboard.bind(programmaticSlider,programmaticChart);
dashboard.draw(linechartdata);
}
</script>
--
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/7d365bfd-aff9-4c7e-be3b-a31d98c9e9ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.