Flot pie chart change position of legends

喜夏-厌秋 提交于 2019-12-23 07:42:47

问题


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
}


来源:https://stackoverflow.com/questions/11951012/flot-pie-chart-change-position-of-legends

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!