mcandre
mcandre

Reputation: 24672

How do I set a minimum step in flot.js without hardcoding a max range?

I'm working on a graph of Tweets per day, and for now the number is small. Small enough that Flot is using steps of 0.1, which doesn't make any sense; there's no such thing as 1/10th of a Tweet.

I tried a few settings to raise the step up to 1, but the only one that worked for me was hardcoding a max range of 100. This is bad, because it displays a near-empty graph when the Tweets are low, and an overflowing graph when the Tweets are high. What's a more permanent solution?

Upvotes: 0

Views: 1388

Answers (1)

DNS
DNS

Reputation: 38219

Use the 'minTickSize' axis option; see the Customizing the Axes section of the docs for more info.

Upvotes: 2

Related Questions