Engage twenty food producers to implement or improve water-efficient agricultural practices to reduce demand on limited water supply.
Cumulative TotalGoal0510152025308Goal 20 ProducersGoal 20 ProducersProgress to DateCumulative Total of Producers
| Element | Cumulative Total | Goal |
|---|
| Start | | 20 |
| Fundraising | 8 | 20 |
| End | | 20 |
Goal
// Load the Visualization API and the corechart package.
google.charts.load(“current”, { packages: [“corechart”] });
google.charts.setOnLoadCallback(drawChart2);
function drawChart2() {
var queryString =
“https://docs.google.com/spreadsheets/d/1x04fW6pC0-EANHW5bTotamLGBxAFWdBOAE64RmAujMs/gviz/tq?gid=1251178687&headers=1”;
var query = new google.visualization.Query(queryString);
query.send(handleQueryResponse2);
}
function handleQueryResponse2(response) {
if (response.isError()) {
alert(
“Error in query: ” +
response.getMessage() +
” ” +
response.getDetailedMessage()
);
return;
}
var sheetData = response.getDataTable();
var cumulativeTotal = sheetData.getValue(0, 1); // Fetching the value from the second row, second column
var tooltipText = sheetData.getValue(0, 3); // Fetching the tooltip
var data = google.visualization.arrayToDataTable([
[
“Element”,
“Cumulative Total”,
{ type: “string”, role: “annotation” },
{ type: “string”, role: “tooltip” },
“Goal”,
{ type: “string”, role: “annotation” },
],
[“Start”, null, null, null, 20, null],
[
“Fundraising”,
cumulativeTotal,
cumulativeTotal,
tooltipText,
20,
null,
],
[“End”, null, null, null, 20, “Goal 20 Producers”],
]);
var options = {
backgroundColor: “#f5f5f5”,
seriesType: “bars”,
series: {
0: {
color: “#3b9825”,
},
1: {
type: “line”,
color: “#F0671c”,
lineWidth: 3,
visibleInLegend: true,
pointSize: 0,
},
},
vAxis: {
minValue: 0,
maxValue: 30,
title: “Cumulative Total of Producers”,
format: “short”,
},
hAxis: {
title: “Progress to Date”,
textPosition: “none”, // Hide axis labels
},
legend: {
position: “top”,
},
};
var chart = new google.visualization.ComboChart(
document.getElementById(“fundraising_chart2”)
);
chart.draw(data, options);
}
Status: Action
Description: Provide resources such as funding, trainings, and technical assistance to food producers that enable them to increase water conservation efforts.
Data Source: Number of producers who have implemented water conservation practices, reported by AZFSN members.
google.charts.load(“current”, {
packages: [“corechart”],
});
google.charts.setOnLoadCallback(drawChartTwo);
function drawChartTwo() {
var queryString = encodeURIComponent(
“SELECT A, B, C, D, E WHERE YEAR(A) = 2023 OR YEAR(A) = 2024”
);
console.log(“Query string:”, queryString); // Log query string
var query = new google.visualization.Query(
“https://docs.google.com/spreadsheets/d/1x04fW6pC0-EANHW5bTotamLGBxAFWdBOAE64RmAujMs/gviz/tq?sheet=Indicator5&tq=” +
queryString
);
query.send(handleSampleDataQueryResponse);
}
function handleSampleDataQueryResponse(response) {
if (response.isError()) {
console.error(
“Error in query: ” +
response.getMessage() +
” ” +
response.getDetailedMessage()
);
alert(
“Error in query: ” +
response.getMessage() +
” ” +
response.getDetailedMessage()
);
return;
}
console.log(“Query response received”); // Log when response is received
writeChart(response.getDataTable());
}
function writeChart(data) {
console.log(“Writing chart with data:”, data); // Log the data received
var tt = new google.visualization.DataTable();
tt.addColumn(“date”, “Date”);
tt.addColumn(“number”, “Weight”);
tt.addColumn({
type: “string”,
role: “annotation”,
});
tt.addColumn({
type: “string”,
role: “tooltip”,
p: {html: true}
});
tt.addColumn({
type: “string”,
role: “style”,
});
for (var i = 0; i < data.getNumberOfRows(); i++) {
var row = [];
row[0] = data.getValue(i, 0); // Date
row[1] = data.getValue(i, 1); // Weight
row[2] = data.getValue(i, 2) ? data.getValue(i, 2).toString() : null; // Annotation
row[3] = data.getValue(i, 3) ? "
” + data.getValue(i, 3).toString() + “
” : null; // HTML Tooltip
row[4] = data.getValue(i, 4) ? data.getValue(i, 4).toString() : null; // Style
tt.addRow(row);
}
var options = {
title: “Timeline of Funding Accumulated”,
hAxis: {
format: “MMM yyyy”,
gridlines: {
color: “transparent”,
},
},
vAxis: {
title: “”,
gridlines: {
color: “transparent”,
},
textPosition: “none”,
baselineColor: “#000000”,
baselineWidth: 2,
},
legend: “none”,
annotations: {
textStyle: {
fontSize: 12,
color: “black”,
},
stem: {
length: -25,
},
highContrast: true,
},
pointSize: 12,
backgroundColor: “#f5f5f5”,
tooltip: {isHtml: true} // Use HTML tooltips
};
var chart = new google.visualization.ScatterChart(
document.getElementById(“chart_div”)
);
var ticks = [];
for (var year = 2023; year <= 2025; year++) {
for (var month = 0; month < 12; month += 3) {
var date = new Date(year, month, 1);
var label = "Q" + Math.floor(month / 3 + 1) + " " + year;
ticks.push({
v: date,
f: label,
});
}
}
options.hAxis.ticks = ticks;
google.visualization.events.addListener(chart, "ready", function () {
Array.prototype.forEach.call(
document.getElementById("chart_div").getElementsByTagName("text"),
function (text, index) {
if (text.getAttribute("text-anchor") === "middle") {
text.setAttribute("fill", "black");
}
}
);
});
console.log("Drawing chart"); // Log before drawing the chart
chart.draw(tt, options);
}
Timeline of Funding AccumulatedQ1 2023Q2 2023Q3 2023Q4 2023Q1 2024Q2 2024Q3 2024Q4 2024Q1 2025Q2 2025Q3 2025Q4 20252/28: 7 Producers Engaged2/28: 7 Producers Engaged12/23: 1 Producer Engaged12/23: 1 Producer Engaged
| Date | Weight |
|---|
| Feb 28, 2023 | 0 |
| Dec 23, 2024 | 0 |
Timeline of Funding Accumulated