javascript morris.js 水平条形图

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13274917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 18:16:57  来源:igfitidea点击:

morris.js horizontal bar chart

javascriptjquerymorris.js

提问by hyperrjas

is it possible add horizontal bar chart with morris.js?

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

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

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

Thank you very much!

非常感谢你!

采纳答案by HBP

A quick perusal of the morris.jswebsite shows no evidence of support for horizontal bar charts.

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

A Google search "horizontal bar charts javascript" shows a number of possible candidates including this one : http://www.rgraph.net/examples/hbar.html

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

回答by Ravindra Gullapalli

If you use morris from https://github.com/JelteF/morris.jsit is possible to see horizontal graphs.

如果您使用https://github.com/JelteF/morris.js 中的morris, 则可以看到水平图。

Working example given in issue # 455is - http://jsbin.com/pucadowa/8/edit?js,output

问题 # 455 中给出的工作示例是 - http://jsbin.com/pucadowa/8/edit?js,output

回答by Bassel Zoaabi

Actually there is, but a lot of code have to be written check this enter link description here

实际上有,但是必须编写很多代码检查此 输入链接描述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
});

回答by Jeremy John

回答by MR_AMDEV

If someone is looking for an updated version of morris then check out this forked version of the original one morrisjs version 6

如果有人正在寻找 morris 的更新版本,请查看原始morrisjs 版本 6 的分叉版本

Plus it is way much better and updated !

此外,它的方式要好得多并且更新了!