Skip to content

Chart api horizontal charts

Yuji Takayama edited this page Jul 10, 2013 · 1 revision

If you want to draw a horizontal bar chart, use a type parameter with css.horizontalBar (or css.ratioHorizontalBar).



  $(function(){
    var data = [
      {
        x: '2013-04',
        y: '123',
      },
      {
        x: '2013-05',
        y: '235',
      },
      {
        x: '2013-06',
        y: '76',
      }
    ];
    var config = {
      data: data,
      type: 'css.horizontalBar',
      autoResize: true,
      yLength: 1
    }
    var range = {
      dataType: 'general',
      length: 3
    }
    new MT.ChartAPI.Graph(config, range).trigger('APPEND_TO', $('#graph'));
  })

Clone this wiki locally