Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools


it:javascript:rickshaw

Rickshaw

  • 没有轴的图只要有 <div id="chart"></div> 和 <script>var graph = ...</script>
  • 一条线: var data = [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 17 }, { x: 3, y: 42 } ];
  • x 和 y 是关键字
  • 数据必须按 x 轴升序排序
  • 使用 timestamp 展现 x 轴: var x_axis = new Rickshaw.Graph.Axis.Time( { graph: graph } );
  • y 轴需要 html 标签和 css 样式
  • 默认为 stack, 线图可用 renderer: 'line'
  • line 支持各线点数不同, stack 不支持
it/javascript/rickshaw.txt · Last modified: 2014/01/03 21:37 by admin