1

我需要实现以下图表

在此处输入图像描述

我知道堆积图,但是这里有轴点标签(在我的需要中没有任何轴点标签),这是来自 Y 轴。

我很困惑如何实现它。

你能帮我么?任何链接也会有所帮助。


更新 :

我正在尝试一个代码片段

<script type="text/javascript" language="javascript">

  $(document).ready(function(){
      var line1 = [14];
      var line2 = [77];
      var plot4 = $.jqplot('test2', [line1, line2], {
          title: '1 Mobility Test Graph',
          animate: !$.jqplot.use_excanvas,
          stackSeries: true, 
          seriesDefaults: {
              renderer: $.jqplot.BarRenderer,
              rendererOptions:{barPadding : 0, barMargin : 5, barDirection: 'horizontal'}, 
              pointLabels:{location : 'e', edgeTolerance : 0, hideZeros: true, show : true},
              shadowAngle : 135,
              lineWidth : 0,
              showLine: true
          },
          axesDefaults : {
                show : false,
                tickOptions : {
                    show : false
                }
            },
          axes: {
              yaxis:{renderer:$.jqplot.CategoryAxisRenderer}
          },
          grid:{
                borderWidth:0, 
                shadow:false
            },
          legend: {
                renderer: $.jqplot.EnhancedLegendRenderer,
                show:true,
                rendererOptions:{
                    numberRows:1,
                    numberColumns: 3,
                    disableIEFading: false
                },
                location: 'n',
                placement : 'outsideGrid',
                marginTop: '5px',
                showSwatch:false
          }
      });
      $(".jqplot-xaxis-tick").hide();
      $(".jqplot-yaxis-tick").hide();
    });
</script>

但这并没有给我任何输出。当我删除barDirection: 'horizontal'它的工作正常。请帮帮我,有什么问题...

在这里,我得到了jsfiddle,但它适用于两个图表......我怎样才能制作一个。

4

1 回答 1

1

你在追求这样的事情?您在那里有一个堆叠的单杠。根据带有水平条形图的文档中的示例,您必须为图表提供一个系列数组,其中每个系列的值作为两个值数组 ([x,y]),其中 x 是值,y 是系列 id。

或者另一种选择是为图表提供单值数组的单个数组,如此处所示

于 2012-10-16T10:01:37.073 回答