Show value within bar on flot bar chart

2019-01-25 07:27发布

问题:

I would like to show the value within the bar on the flot bar chart, something like this:

|
|               +----+
|               |    |
|               |    |
|               |    |
|   +----+      | 20 |
|   |    |      |    |
|   | 10 |      |    |
|   |    |      |    |
|---+----+------+----+------

data = [[1, 10], [2, 20]]

Is there a way to do this?

回答1:

I needed the same thing, so I quickly hacked together a plugin for it and a quick example of it in action.



回答2:

I think your answer is here:

http://code.google.com/p/flot/issues/detail?id=218