Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it so turning on filling under a plot line does not force the axis.min to go to 0 #856

Closed
wants to merge 1 commit into from
Closed

Conversation

ara818
Copy link
Contributor

@ara818 ara818 commented Nov 8, 2012

Mainline flot currently has a behavior where when "fill" is turned on for a line chart, the axis.min is set to 0, so the fill goes to the "zero line" ... In my use case at least, this completely distorts the chart and seems like an odd default behavior. This small change makes it so this doesn't happen, axis min/max is not affected by whether fill is on or off.

Note: This is not actually my patch, it is copied from comment on an issue filed in the old flot Google Code repo. Since it is no longer available, I can't give proper credit.

@ghost ghost assigned dnschnur Nov 22, 2012
@dnschnur
Copy link
Member

This is a tricky one; I have a couple of branches in my local copy where I'm working on exactly this.

The problem is that the current behavior is technically correct. An area plot isn't just a fancy line; it's the filled region that represents the value. Starting from something other than zero completely distorts the meaning of the plot.

On the other hand there are cases where the meaning of the plot doesn't isn't as important, and filling in the line is just decorative. I work on a product using Flot, and we've had a couple of bug reports from people who think it's weird that switching from line to area affects the axis.

Simply switching one way or another won't work; someone will complain either way. We need to introduce an option: a flag that determines whether to use auto-scaling or not, so people can choose which behavior they want.

I'm closing this, but if you're interested in working on a flag, I would love to pull that into the 0.8 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants