Flot pie chart change position of legends

2019-06-17 01:06发布

问题:

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

回答1:

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?



回答2:

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
}


标签: flot legend