我下载了一个示例,用户 Keen.js 可以为饼图提取数据。
我只需要将一些数据硬编码到图表中,
例如 50% 通过,50% 失败。
var pageviews_static = new Keen.Query("count", {
eventCollection: "pageviews",
groupBy: "user.device_info.browser.family",
timeframe: {
start: "2014-05-01T00:00:00.000Z",
end: "2014-05-05T00:00:00.000Z"
}
});
client.draw(pageviews_static, document.getElementById("chart-02"), {
chartType: "piechart",
title: false,
height: 250,
width: "auto",
chartOptions: {
chartArea: {
height: "85%",
left: "5%",
top: "5%",
width: "100%"
},
pieHole: .4
}
});
如何将 pageview_static 硬编码为 50% 通过,50% 失败