首页 文章

使用JQPlot,如何将图表放在图表外的特定位置?

提问于
浏览
2

我正在使用以下内容将图例成功放置在JQPlot折线图之外:

legend:{show:true,location:'sw',placement:'outside'},

但是,这使得图例太靠近图表,与我的yaxis标签一致 . 我需要将它进一步向左移动 . 有没有办法做到这一点?

谢谢 .

3 回答

  • 1

    有点晚了,当然,但我知道了!您应该使用 placement: 'outsideGrid' 而不是 placement: 'outside' ,因为'outsideGrid'将缩小图例的图形区域,使其不与其混合 .

    希望这有帮助!

    尼科

  • 3

    检查Legend的marginTop,marginRight,marginBottom,marginLeft属性 .

    你应该能够做到:

    legend: { 
        show: true, 
        location: 'sw', 
        placement: 'outside',
        marginLeft: 300
    }
    
  • 5

    你必须像这样使用它 . marginLeft : "300px"

    legend: { 
    show: true, 
    location: 'sw', 
    placement: 'outside',
    marginLeft: "300px"
    

    }

相关问题