图表绘制 HTML5
2013-09-23 09:55
246 查看
应用:http://www.highcharts.com/demo/pie-basic
思路很不错
def all_courses_select_apply_pie @courses = CourseIntent.intent_course_ranking stat = { :notfull => 20, :full => 9, :over => 8, :empty => 11 } render :json => stat end
.chart .page-chart.all-courses-select-apply-pie
jQuery -> jQuery('.page-chart.all-courses-select-apply-pie').each -> $chart = jQuery(this) jQuery.ajax url: '/charts/courses/all_courses_select_apply_pie' success: (res)-> notfull = res.notfull over = res.over full = res.full empty = res.empty option = chart: plotBackgroundColor: null plotBorderWidth: null plotShadow: false backgroundColor: null title: text: null plotOptions: pie: allowPointSelect: false showInLegend: true cursor: 'pointer' series: [ { type: 'pie' name: '课程数' animation: false # point: # events: # click: (e)-> # location.href = "/manage/courses?select_apply_status=#{this.label}" dataLabels: format: '<b>{point.name}</b>: {point.y}' color: 'black' distance: 25 style: fontSize: '15px' fontWeight: 'bold' data: [ { label: 'notfull' name: '人数过少' y: notfull color: '#FEF093' }, { label: 'over' name: '人数过多' y: over color: '#cc3333' }, { label: 'full' name: '人数适合' y: full color: '#80CC00' }, { label: 'empty' name: '无人选' y: empty color: '#CDCDCD' }, ] } ] $chart.highcharts option
相关文章推荐
- chart.js + bootstrap +jquery.js 实现的 html5 图表绘制效果
- Android使用ichartjs在HTML5中动态绘制图表
- 怎样使用绘制HTML5图表和图形库Flotr2
- fusioncharts 3.4 抛弃swf的方式,采用纯js的html5 进行图表绘制后出现的一些问题。
- Chart.js 轻量级HTML5图表绘制工具库(知识整理)
- Chart.js | HTML5 图表绘制工具库(知识整理)
- 让IE8支持HTML5及canvas功能!chart.js图表绘制工具库IE8上兼容方案
- HTML5学习——jChartFx绘制网页图表
- HTML5中canvas画图之绘制数据图表
- 使用绘图类库flotr2来绘制HTML5的图形和图表
- 国内一款优秀的开源HTML5图表绘制框架-ichartjs
- echarts(国产)基于html5-canvas的开源图表绘制组件
- Chart.js | HTML5 图表绘制工具库(知识整理)
- iOS 使用 Core Plot 绘制统计图表入门
- html5-循环方式-绘制矩形
- iOS 统计图表绘制(UITableView、UIBezierPath)
- Python图表绘制:matplotlib绘图库入门
- 使用Office2000中的图表控件绘制图形~
- 纯Shading Language绘制HTML5时钟
- 使用Flot+AJAX绘制图表