-
Notifications
You must be signed in to change notification settings - Fork 940
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
Colum items not rendered properly when using a logarithmic Y axis #740
Comments
For my bars to display "properly", I have to set a base Value = 1 on the series. The problem is I might have values < 1, then they don't get displayed. I need to have a minimum = 0 on the Y axis declaration and the same for the categories values. |
Does your commit fix the bug? Cheers |
No, it was just adding your example reproducing the bug. |
The same issue occurs with stem plot. |
@objorke i tried with different graphs with logarithmic axis for area, line, scatter, i can also see the same issue ,is there any fix ,or quick fix for this . Can you please suggest the fix for the above problem |
@udaykolluru which issue exactly? Line, scatter, and 2-line area series should be fine, since they don't need a base-line. It sounds like you may have a different problem: could you provide some example code? The behaviour described above is certainly inconsistent (which isn't ideal), but logarithmic scales don't have a natural finite zero. Area plots (of which histograms and column plots are different types) usually don't make sense with a logarithmic y-axis, because the area always has to be relative to some baseline. I'd expect the default behaviour to be that the bar goes on to -infinity (which the data probably is, and is probably causes issues with different renderers: e.g. WPF 'inverting' large and small values is a common symptom), but that's basically of no use to anyone: you need to pick a meaningful baseline; if you don't have a meaningful baseline, then you should probably reconsider using a chart with an area. Some more commentary on column charts with logarithmic scale can be found in the graph pad guide |
@VisualMelon @objorke I was trying LogarithmicAxis with HistogramSeries in latest Oxyplot 2.0. The graph looks inverted. How can this be corrected? |
@swethakini-ofc |
@VisualMelon What about Column Series. Even excel provides logarithmic scale for Y axis |
@swethakini-ofc with column series, you can set the |
@VisualMelon Thanks this worked 👍 |
* Add demo for LinearBarSeries with logarithmic axis. * Fix for logarithmic LinearBarSeries. * Fix for padding calculation for logarithmic axis. * Updated Changelog. * Use BaseLine and LowestValidRoundTripValue on LogarithmicAxis to render LineBarSeries correctly. * Better separated box generation from zoom. --------- Co-authored-by: VisualMelon <VisualMelon@users.noreply.github.com>
As discussed there: http://discussion.oxyplot.org/topic/1041311-colum-items-not-rendered-properly-when-using-a-logarithmic-y-axis/#
In the oxyplot sample, there are two demos making use of Bars and Columns: BarSeriesDemo and ColumnSeriesDemo.
For the first, using a logarithmic axis in place of the linear one as Y axis does not cause any problem, the values are displayed correctly:
However, when doing the same with the demo ColumnSeriesDemo, the bars are not drawn correctly it seems, looks like they are "reversed":
In the class ColumnSeriesDemo.MainWindow, I changed the lines 43 and 44 from
tmp.Axes.Add(new CategoryAxis { ItemsSource = this.Items, LabelField = "Label" });
tmp.Axes.Add(new LinearAxis { Position = AxisPosition.Left, MinimumPadding = 0, AbsoluteMinimum = 0 });
To
tmp.Axes.Add(new CategoryAxis { Position = AxisPosition.Bottom, ItemsSource = this.Items, LabelField = "Label" });
tmp.Axes.Add(new LogarithmicAxis { Position = AxisPosition.Left, Minimum = 1, Base = 10 });
With code behind:
With xaml, without the log Y axis:
Why doesn't it behave the same way?
The text was updated successfully, but these errors were encountered: