algraph:円グラフ
文書の過去の版を表示しています。
円グラフ
テンプレートファイル
- index.html
<!DOCTYPE html> <object width="320" height="240" type="image/svg+xml" data="<%= Alone.make_uri(action:'graph_sample') %>"></object>
コード
- main.rb
require 'al_template' require 'al_graph_pie' class GraphSampleController < AlController def action_index() AlTemplate.run( 'index.rhtml' ) end def action_graph_sample() ydata1 = [5, 3, 6, 3, 2, 5, 6] labels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] graph = AlGraphPie.new graph.add_data(ydata1, labels) graph.draw end end
折れ線グラフ、棒グラフと違い、requireが'al_graph'から'al_graph_pie'に、クラスが AlGraphからAlGraphPie等に変わる点にご注意ください。
サンプル
リリースファイルでサンプルとして提供しているものです。
デフォルト(再掲)
セパレートして強調
algraph/円グラフ.1549245603.txt.gz · 最終更新: 2019/02/04 11:00 by 127.0.0.1