Chart scaling problem in LightningChart SDK

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Exohorn
    New Member
    • Nov 2013
    • 1

    Chart scaling problem in LightningChart SDK

    Hello everyone,
    I am currently getting used to LightningChart SDK for .NET, trying tutorials and moving my own program to the usage of this SDK.
    While making a simple Point-Line chart, I encountered a small problem. I receiving chart data from a tested sensor, and the difference in sensor measurement output can vary. However, I don't know how to scale the chart itself dynamically so that user would always see all the data. You can see the problem in attached image - the chart goes up off-screen.
    Here is my chart creating func:
    Code:
    private void CreateChart()
            {
                VoltCh.BeginUpdate();
    
                AxisX xAxis = VoltCh.ViewXY.XAxes[0];
                xAxis.ValueType = AxisValueType.Number;
                xAxis.SetRange(0, 100); //Let's test first in seconds
                xAxis.Title.Text = "Time";
    
                AxisY yAxis = VoltCh.ViewXY.YAxes[0];
                yAxis.SetRange(20, 50);
                yAxis.Title.Text = "Voltage [V]";
                PointLineSeries series = new PointLineSeries(VoltCh.ViewXY, xAxis, yAxis);
    
                VoltCh.ViewXY.PointLineSeries.Add(series);
                VoltCh.EndUpdate();
            }
    So, is there a parameter in LightningChart SDK to make in dynamically scale the chart axis or should I make a looping function for that?
    Attached Files
Working...