Peek.js 介绍
Peek.js 是一个用于 Web 应用的图表生成库,基于 D3.js 开发。特性:
-
面向对象可重用的图表
-
JSON 数据格式
-
易于理解和定制
示例代码:
/* Charts are instantiated as objects. There are two different ways to pass data and draw the chart: i) by passing a data array to render() directly var trend_chart = new Trend("#trend-chart"); trend_chart.render(trend_data); ii) by setting the url to the data and calling draw() var trend_chart = new Trend("#trend-chart"); trend_chart.url = 'trend.json'; chart.draw(); */ var trend_chart = new Trend("#trend-chart"); //trend_chart.interpolate = "monotone"; //default=cardinal trend_chart.showTooltip = true; trend_chart.render(trend_data); var stacked_chart = new Stacked("#stacked-bar-chart"); stacked_chart.render(stacked_data); var compare_chart = new Compare('#compare-chart'); compare_chart.render(horizontal_bar_data); var pie_one = new Pie("#pie-one"); var pie_two = new Pie("#pie-two"); pie_one.render(pie_data_one); pie_two.render(pie_data_two); pie_one.legend("#pie-legend", pie_data_one);
Peek.js 官网
http://mtmacdonald.github.io/peek/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。