首页 文章

jqPlot:重叠的条形图可能吗?

提问于
浏览
0

一个例子可能描述了我想要最容易实现的目标 .

如果我有,例如,系列[80,70]和[90,90],我希望第一个堆叠的条带的第一个系列'颜色从0到80,然后另一个系列'颜色从80 -90 . 现在我把它们放在彼此之上,产生了170个单位高的酒吧 .

Javascript代码:

plot3 = $.jqplot('chartdiv', [normalSeries, distSeries], {
        stackSeries: true,
        captureRightClick: true,
        seriesDefaults: {
            renderer: $.jqplot.BarRenderer,
            rendererOptions: {
                barMargin: 20,
                barWidth: 10,
                highlightMouseDown: true
            },
            pointLabels: { show: true }
        },
        axes: {
            xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer,
                ticks: schoolNames
            },
            yaxis: {
                padMin: 0
            }
        },
        legend: {
            show: true,
            location: 'e',
            placement: 'outside'
        }
    });

提前致谢!

1 回答

  • 0

    实际上,可以使用一些数据预处理来完成 . 但我很感兴趣为什么首先需要这个?以防万一,如果第二个系列点值小于第一个,那么除非您打算仅通过反转显示颜色帮助用户,否则它将如何显示?

    对我来说,堆叠很简单:a坐在b上 - 无论他们的个人 Value 是多少 . 如果你使用环形交叉口来达到你的“要求”,我最好的猜测是用户会感到困惑 .

    您可能想查看其他选项:Jqplot different kinds of rendering in one chart

相关问题