What error messages does it throw? Open the page in Chrome and view the
developer's console to see them.
On Tuesday, May 6, 2014 9:10:48 AM UTC-4, Steven Downs wrote:
>
> Andrew, thank you for taking the time to address my question.
> Unfortunately, the code provided did not work.
>
> On Monday, May 5, 2014 9:01:57 PM UTC-5, Andrew Gallant wrote:
>>
>> I suspect that you would have better luck doing it this way:
>>
>> google.load("visualization", "1", { packages: ["gauge"] });
>> google.setOnLoadCallback(drawChart);
>> function drawChart() {
>> jQuery().SPServices({
>> operation: "GetListItems",
>> webURL: "/sites/PowerUP/Dashboard/",
>> listName: "MemberSummary",
>> async: false,
>> CAMLViewFields: "<ViewFields><FieldRef Name='Count'
>> /></ViewFields>",
>> CAMLRowLimit: 1,
>> completefunc: function (xData, Status) {
>> var filter;
>> jQuery(xData.responseXML).SPFilterNode("z:row").each(function
>> () {
>> var node = jQuery(this);
>> filter = node.attr("ows_Count");
>> });
>> var data = google.visualization.arrayToDataTable([
>> ['Label', 'Value'],
>> ["Posts", filter]
>> ]);
>>
>> var options = {
>> width: 400
>> };
>>
>> var chart= new
>> google.visualization.Gauge(document.getElementById('function-breakout'));
>> chart.draw(data, options);
>> }
>> });
>> }
>>
>> On Monday, May 5, 2014 4:58:02 PM UTC-4, Steven Downs wrote:
>>>
>>> Hi everyone, I'm having some issues with what should be a simple gauge
>>> chart and a call to a sharepoint list. My code is below. I've bolded the
>>> "filter" value, as it is the only one i need to reference - it holds the
>>> data. I even have an alert to display the number to prove it actually is
>>> available for the chart. Any issues with my google chart code? Any
>>> suggestions??
>>>
>>> <script type="text/javascript" src="https://www.google.com/jsapi
>>> "></script>
>>> <script type="text/javascript">
>>>
>>> jQuery().SPServices({
>>> operation: "GetListItems",
>>> webURL: "/sites/PowerUP/Dashboard/",
>>> listName: "MemberSummary",
>>> async: false,
>>> CAMLViewFields: "<ViewFields><FieldRef Name='Count' /></ViewFields>",
>>> CAMLRowLimit: 1,
>>> completefunc: function (xData, Status) {
>>> jQuery(xData.responseXML).SPFilterNode("z:row").each(function ()
>>> {
>>> var node = jQuery(this);
>>> * filter* = node.attr("ows_Count");
>>> });
>>> }
>>> });
>>>
>>> google.load("visualization", "1", { packages: ["gauge"] });
>>> google.setOnLoadCallback(drawChart);
>>> function drawChart() {
>>> var data = google.visualization.arrayToDataTable([
>>> ['Label', 'Value'],
>>> ["Posts", *filter*]
>>> ]);
>>>
>>> var options = {
>>> width: 400
>>> };
>>>
>>> var chart= new
>>> google.visualization.Gauge(document.getElementById('function-breakout'));
>>> chart.draw(data, options);
>>> alert(filter);
>>> }
>>>
>>> </script>
>>>
>>> <div class="chart-holder">
>>> <h2 align="center">Posts</h2>
>>> <div id="function-breakout" style="width:400px; height: 250px;"
>>> align="center"></div>
>>> </div>
>>>
>>>
--
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/d/optout.