Hello,
I removed the “state” and that helped. I still have an issue where the date
the is being fed in is being tied to Epoch. When I pull the data from the
database I use the following
"$temp[] = array('v' => (int) date('mdY',strtotime($r['INSERT_TIME'])));”
I then try to build the DateRangeFilter with the following:
programmaticSlider = new google.visualization.ControlWrapper({
'controlType': 'DateRangeFilter',
'containerId': 'programmatic_control_div',
'options': {
'filterColumnLabel': 'Time',
'ui': {
format:{pattern: "mdY"}
}
}
});
The date in comes in as format: “12292015”
I am so close with your help so I would really appreciate it if you could help
steer me in the right direction.
Thanks!
From: <[email protected]> on behalf of 'Daniel
LaLiberte' via Google Visualization API
<[email protected]>
Reply-To: <[email protected]>
Date: Wednesday, January 6, 2016 at 12:21 PM
To: Google Visualization API <[email protected]>
Subject: Re: [visualization-api] Trouble with Chart Control
Brent,
I believe we have some issues with setting the 'state' of the DateRangeFilter,
so if you can take that option out, it might work better.
But your dates should not be formatted as strings that way. If you need to use
strings, use the form "Date(yyyy, MM, dd, hh, mm, ss)" whereMM is the
zero-based month.
On Tue, Jan 5, 2016 at 10:10 PM, Brent Bensten <[email protected]> wrote:
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.
--
Daniel LaLiberte
[email protected] 5CC, Cambridge MA
--
You received this message because you are subscribed to a topic in the Google
Groups "Google Visualization API" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/google-visualization-api/rVQodNfpCTs/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAOtcSJPgRni-fZo5dC-tKBMJpd24oOyxgJnhYZCuyjaq2X%3DexQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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/2B610DE8-076B-4EEB-A547-E9B0049613AF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.