đang diễn ra
đã kết thúc
Địa phương có dịch chưa qua 21 ngày
Biểu đồ dịch bệnh theo ngày
Biểu đồ dịch bệnh theo tháng
]);
var options = {
titleTextStyle: { fontSize: 12, color: "#333" },
chartArea: {width: '90%', height: '80%'},
//pieSliceText: 'label',
backgroundColor: { fill: 'transparent' }
};
//var chart = new google.visualization.PieChart(document.getElementById('piechart2'));
//chart.draw(data, options);
var chart = new google.visualization.ChartWrapper({
containerId: 'piechart2',
chartType: 'PieChart'
});
chart.setOptions(options);
chart.setDataTable(data);
chart.draw();
$('#btSaveDestroySpecies').click(function () {
//alert("click");
var dlLink = document.createElement('a');
dlLink.download = 'destroySpecieschart' + Math.random() + '.png';
dlLink.href = chart.getChart().getImageURI();
dlLink.target = "_blank";
document.body.appendChild(dlLink);
dlLink.click();
document.body.removeChild(dlLink);
});
}
function drawChart3() {
var data = google.visualization.arrayToDataTable([]);
var options = {
titleTextStyle: { fontSize: 12, color: "#333" },
chartArea: { width: '90%', height: '80%' },
//pieSliceText: 'label',
backgroundColor: { fill: 'transparent' }
};
//var chart = new google.visualization.PieChart(document.getElementById('piechart3'));
//chart.draw(data, options);
var chart = new google.visualization.ChartWrapper({
containerId: 'piechart3',
chartType: 'PieChart'
});
// Wait for the chart to finish drawing before calling the getImageURI() method.
google.visualization.events.addListener(chart, 'ready', function () {
$('#btSaveInfectedSpecies').click(function () {
//alert("click");
var dlLink = document.createElement('a');
dlLink.download = 'infectedSpecieschart' + Math.random() + '.png';
dlLink.href = chart.getChart().getImageURI();
dlLink.target = "_blank";
document.body.appendChild(dlLink);
dlLink.click();
document.body.removeChild(dlLink);
});
});
chart.setOptions(options);
chart.setDataTable(data);
chart.draw();
}
///chart functions - outbreak chart
google.charts.load("current", { packages: ['corechart'] });
google.charts.setOnLoadCallback(drawObChart);
function drawObChart() {
$.ajax({
url: "",
dataType: "json",
async: false,
success: function (jsonData) {
var data = new google.visualization.DataTable(jsonData);
var options = {
width: '100%',
height: 350,
colors: ["red"],
legend: "none",
chartArea: { width: '90%' },
vAxis: {
viewWindow: { min: 0 },
format: '#'
}
};
//var obchart = new google.visualization.AreaChart(document.getElementById('outbreak_chart'));
//obchart.draw(data, options);
var obchart = new google.visualization.ChartWrapper({
containerId: 'outbreak_chart',
chartType: 'AreaChart'
});
// Wait for the chart to finish drawing before calling the getImageURI() method.
google.visualization.events.addListener(obchart, 'ready', function () {
// document.getElementById('Div1').src=chart.getImageURI();
// $('#btSave').attr("href",chart.getImageURI());
});
obchart.setOptions(options);
obchart.setDataTable(data);
obchart.draw();
$('#btSave').click(function () {
//alert("click");
var dlLink = document.createElement('a');
dlLink.download = 'timechart' + Math.random() + '.png';
dlLink.href = obchart.getChart().getImageURI();
dlLink.target = "_blank";
document.body.appendChild(dlLink);
dlLink.click();
document.body.removeChild(dlLink);
});
}
});
}
///
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawPlaceChart);
////Affected chart
//google.charts.setOnLoadCallback(drawAffectChart);
function drawPlaceChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Tháng');
data.addColumn('number', "Số tỉnh");
data.addColumn('number', "Số quận/huyện");
data.addColumn('number', "Số phường/xã");
data.addRows([
]);
var placeOptions = {
backgroundColor: { fill: 'transparent' },
width: '100%',
height: 350,
chartArea: { width: '90%', height: '80%' },
legend: { position: "top", alignment: "center" },
focusTarget: 'category',
theme: 'material',
vAxis: {
viewWindow: { min: 0 },
format: '#'
}
};
var placeChart = new google.visualization.LineChart(document.getElementById('place_chart'));
placeChart.draw(data, placeOptions);
var placeChart = new google.visualization.ChartWrapper({
containerId: 'place_chart',
chartType: 'LineChart'
});
placeChart.setOptions(placeOptions);
placeChart.setDataTable(data);
placeChart.draw();
$('#btSavePlace').click(function () {
//alert("click");
var dlLink = document.createElement('a');
dlLink.download = 'placechart' + Math.random() + '.png';
dlLink.href = placeChart.getChart().getImageURI();
dlLink.target = "_blank";
document.body.appendChild(dlLink);
dlLink.click();
document.body.removeChild(dlLink);
});
}
//table chart
google.charts.load('current', { 'packages': ['table'] });
google.charts.setOnLoadCallback(drawTable);
function drawTable() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Tỉnh/thành');
data.addColumn('number', 'Số Quận/huyện');
data.addColumn('number', 'Phường/xã');
data.addColumn('number', 'Số ổ dịch');
data.addColumn('number', 'Số tiêu hủy');
// data.addColumn('number', 'Lượng tiêu hủy (Kg)');
data.addRows([]);
var tblOptions = {
title: 'Địa phương có dịch trong năm',
backgroundColor: { fill: 'transparent' },
showRowNumber: true,
allowHtml: true,
sortColumn: 3,
sortAscending: false,
height: '200px',
width: '100%'
};
var formatter = new google.visualization.BarFormat({ width: 200 });
formatter.format(data, 1);
var formatter1 = new google.visualization.BarFormat({ width: 200, colorPositive: 'green' });
formatter1.format(data, 2);
var formatter1 = new google.visualization.BarFormat({ width: 200, colorPositive: 'red' });
formatter1.format(data, 3);
// formatter.format(data, 4)
var table = new google.visualization.Table(document.getElementById('table_chart'));
table.draw(data, tblOptions);
}
function copyDivToClipboard(divID) {
var range = document.createRange();
range.selectNode(document.getElementById(divID));
window.getSelection().removeAllRanges(); // clear current selection
window.getSelection().addRange(range); // to select text
document.execCommand("copy");
window.getSelection().removeAllRanges();// to deselect
}