jaseFace
jaseFace

Reputation: 1455

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

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 the grid markings.

Any help appreciated

Upvotes: 1

Views: 2327

Answers (4)

tzed
tzed

Reputation: 11

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.

Upvotes: 1

DarrellNorton
DarrellNorton

Reputation: 4661

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: alt text

Upvotes: 0

rossdavidh
rossdavidh

Reputation: 1996

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.

Upvotes: 0

  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 }

Upvotes: 1

Related Questions