绘制饼图改变传说的位置

Har*_*iya 8 legend flot

我们可以将默认左侧的图例位置更改为右侧或底部吗?

我们如何在鼠标指针上实现悬停,内容应该显示在鼠标指针而不是其他DIV中

Mar*_*ark 11

图例选项采用"位置"属性来指定其位置:

  legend: {
    position: "ne" or "nw" or "se" or "sw"
  }
Run Code Online (Sandbox Code Playgroud)

"鼠标指针"是什么意思?你想要"内容"跟随指针吗?


Ond*_*žka 6

这是您正在使用的库的文档:

https://github.com/flot/flot/blob/master/API.md#customizing-the-legend

legend: {
    show: boolean
    labelFormatter: null or (fn: string, series object -> string)
    labelBoxBorderColor: color
    noColumns: number
    position: "ne" or "nw" or "se" or "sw"
    margin: number of pixels or [x margin, y margin]
    backgroundColor: null or color
    backgroundOpacity: number between 0 and 1
    container: null or jQuery object/DOM element/jQuery expression
    sorted: null/false, true, "ascending", "descending", "reverse", or a comparator
}
Run Code Online (Sandbox Code Playgroud)