开发者

flot line graphs how do I replace points with icon and remove grid markings?

开发者 https://www.devze.com 2023-01-21 04:00 出处:网络
I\'m trying to achieve the following in Flot and was wondering if an experienced user could offer some insight.

I'm trying to achieve the following in Flot and was wondering if an experienced user could offer some insight.

  1. I'd like to replace various plot points with a graphic (not the entire series).

  2. I'd like to remove t开发者_开发知识库he grid markings.

Any help appreciated


  1. Sounds very tricky unless you want to hack around with Flot itself / create a plugin

  2. Grid lines can be configured using the following option:

    grid: { show: false }


I see it's an old topic but anyway for question #2 options:xaxis{tickLength: 0} and options:yaxis{tickLength: 0} does the job. It's described in the flot's API.txt too.


You could use the same idea that's used for a tooltip, and make its position be the same as the point itself. Then the "tooltip" would be an image rather than text.

Example of flot tooltip here. The example adds 5 to both x and y to avoid obscuring the point, you could remove that part.


You can use the Flot Symbols plugin. It offers a few new point types (square, triangle, diamond, cross).

Or you can override the callback function and write a little JavaScript to create your own symbol. Someone created a vector symbol plugin that shows the trend of the data:

flot line graphs how do I replace points with icon and remove grid markings?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号