Reputation: 1267
I have a software that displays charts using Visiblox.
The user can change the style of any of the axes from linear to logarithmic. And I have a small problem:
When zoomed the linear chart will display grid lines on the graph and values on the axis, as can be seen in the following two pictures:
The problem is that when switched to logarithmic mode the chart no linger displays the reference numbers or grid lines when zoomed:
So our users are now complaining they have no reference to analyze the curves. We don't do any special configuration to linear axes opposed to log ones here's the code:
for linear axes:
this.CalibrationChartXAxis = new LinearAxis();
this.CalibrationChartYAxis = new LinearAxis();
for log axes:
this.CalibrationChartXAxis = new LogarithmicAxis();
this.CalibrationChartYAxis = new LogarithmicAxis();
adding the ranges:
this.CalibrationChartXAxis.Range = new DoubleRange(minX, maxX);
this.CalibrationChartYAxis.Range = new DoubleRange(minY, maxY);
and of course binding them to the view:
<Grid Grid.Row="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
<charts:Chart x:Name="PlotChart" Behaviour="{Binding Path=CalibrationCurveChartViewModel.PlotChartBehavior}"
XAxis="{Binding Path=CalibrationCurveChartViewModel.CalibrationChartXAxis}"
YAxis="{Binding Path=CalibrationCurveChartViewModel.CalibrationChartYAxis}"
Background="Transparent" LegendVisibility="Collapsed" Margin="0" BorderBrush="Blue" BorderThickness="1">
<charts:Chart.Series>
...
</charts:Chart.Series>
</charts:Chart>
</Grid>
I have no idea why the two axes types behave differently. I've tried turning AutoScaleToVisibleData on and off, or setting ShowMinorTicks, but that seems to do nothing. I'm at a loss about what to do. Can anyone help?
Upvotes: 0
Views: 148
Reputation: 3764
I ran into something similar before. Not sure if this is related, but you can check out this post for a possible workaround.
Upvotes: 0