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);
}
}
- Ben Green asked 9 months ago
- last edited 9 months ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 9 months ago
- last edited 9 months ago
- You must login to post comments
Please login first to submit.