Pre loader

LogarithmicNumericAxis does not respect VisibleRange setting

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
0
0

Setting VisibleRange in xaml or in code behind does not seem to work. It always defaults to (0.1, 100)

 <s:SciChartSurface x:Name="positiveScaleChart"
                    Loaded="OnLogarithmicAxisViewLoaded">

     <s:SciChartSurface.RenderableSeries>
         <s:FastLineRenderableSeries />
     </s:SciChartSurface.RenderableSeries>

     <s:SciChartSurface.XAxis>
         <s:NumericAxis TextFormatting="0"
                        VisibleRange="0, 100"
                        AutoRange="Never" />
     </s:SciChartSurface.XAxis>

     <s:SciChartSurface.YAxis>
         <s:LogarithmicNumericAxis AxisAlignment="Left"
                                   TextFormatting="0"
                                   AutoRange="Never"
                                   VisibleRange="-1, 10000">

         </s:LogarithmicNumericAxis>
     </s:SciChartSurface.YAxis>
 </s:SciChartSurface>



 public partial class LogarithmicAxisView : UserControl
 {
     public LogarithmicAxisView()
     {
         InitializeComponent();
     }

     private void OnLogarithmicAxisViewLoaded(object sender, RoutedEventArgs e)
     {
         var posDataSeries0 = new XyDataSeries<double, double>();

         var data1 = new DoubleSeries();

         for (int i = 0; i < 100; ++i)
         {
             data1.Add(new XYPoint() { X = i, Y = Math.Pow(i, 3) });
         }

         posDataSeries0.Append(data1.XData, data1.YData);
         positiveScaleChart.RenderableSeries[0].DataSeries = posDataSeries0;
         positiveScaleChart.YAxis.VisibleRange = new DoubleRange(-1, 10000);
     }
 }
Version
7.0.2.27161
  • You must to post comments
Best Answer
1
0

Hi there,

We don’t support a VisibleRange of [-1, 10000] in Logarithmic space as the difference between numbers either side of zero is infinity. What SciChart is doing is recognising the range is invalid and setting a default range.

You can set any non-zero number such as [0.1, 10000] or any non-zero negative numbers such as [-10000, -0.1] but not span zero, and not zero itself.

Here’s an example showing that you can have negative and positive numbers on log axis: https://www.scichart.com/example/wpf-chart/wpf-chart-example-logarithmic-axis/

Unfortunately not a way to allow both on the same axis.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.