Flot pie chart change position of legends

2019-06-17 00:56发布

Can we change the position of legends from default left side to right or bottom?

How can we implement hover on mouse pointer that is the content should be shown on the mouse pointer and not in other DIV

标签: flot legend
2条回答
对你真心纯属浪费
2楼-- · 2019-06-17 01:08

The legend option takes a "position" attribute to specify it's location:

  legend: {
    position: "ne" or "nw" or "se" or "sw"
  }

What do you mean by "on the mouse pointer". Would you like the "content" to follow the pointer?

查看更多
不美不萌又怎样
3楼-- · 2019-06-17 01:28

Here's the documentation of the library you're using:

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
}
查看更多
登录 后发表回答