morris.js水平条形图

问题描述:

是否可以使用morris.js添加水平条形图?morris.js水平条形图

http://jsbin.com/uzosiq/2/embed?javascript,live

非常感谢您!

morris.js网站的快速浏览显示没有证据支持水平条形图。

谷歌搜索“水平条形图的javascript”显示了一些可能的候选人包括这一个:http://www.rgraph.net/examples/hbar.html

+0

非常感谢你 – hyperrjas

我不这么认为,但你可以尝试

http://www.jqplot.com/tests/bar-charts.php

http://www.jscharts.com

如果您使用来自https://github.com/JelteF/morris.js的morris 可以看到水平图。在问题#455给出

工作实例 - http://jsbin.com/pucadowa/8/edit?js,output

其实有, 但大量的代码已经被写入 检查这个 enter link description here

/* 
* Play with this code and it'll update in the panel opposite. 
* 
* Why not try some of the options above? 
*/ 
/* @license 
morris.js v0.5.0 
Copyright 2014 Olly Smith All rights reserved. 
Licensed under the BSD-2-Clause License. 
*/ 
/* @license 
morris.js v0.5.1 
Copyright 2014 Olly Smith All rights reserved. 
Licensed under the BSD-2-Clause License. 
*/ 
(function(){var a,b,c,d,e=[].slice,f=function(a,b){return function(){return .......}).call(this); 


Morris.Bar({ 
    element: 'bar-example', 
    data: [ 
    { y: '2006', a: 100, b: 90 }, 
    { y: '2007', a: 75, b: 65 }, 
    { y: '2008', a: 50, b: 40 }, 
    { y: '2009', a: 75, b: 65 }, 
    { y: '2010', a: 50, b: 40 }, 
    { y: '2011', a: 75, b: 65 }, 
    { y: '2012', a: 100, b: 90 } 
    ], 
    xkey: 'y', 
    ykeys: ['a', 'b'], 
    labels: ['Series A', 'Series B'], 
    horizontal: true, 
    stacked: true 
});