这是什么图表API /工具?
http://wordpress.org/extend/plugins/multiple-post-thumbnails/stats/
饼图至少是iframe内的svg画布。我很困惑他们正在使用什么,但我喜欢它。
答案 0 :(得分:1)
google.load("visualization", "1", {packages: ["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
jQuery.getJSON('http://api.wordpress.org/stats/plugin/1.0/multiple-post-thumbnails?callback=?', function (data) {
draw_graph(data, 'version_stats', 'Active Versions');
});
}
function draw_graph(versions, id, title) {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Version');
data.addColumn('number', 'Usage');
var count = 0;
jQuery.each(versions, function (key, value) {
if (Number(value) > 1) {
data.addRow();
data.setValue(count, 0, key);
data.setValue(count, 1, Number(value));
count++;
}
});
var chart = new google.visualization.PieChart(document.getElementById(id));
chart.draw(data, {width: 360, height: 240, title: title});
}
看起来他们正在使用Google的图表API:http://code.google.com/apis/chart/interactive/docs/index.html