Articles in this section
Category / Section

How to get axis range in UWP chart?

3 mins read

The UWP Chart has two range types, the ActualRange and the VisibleRange. The value of the ActualRange retains the whole axis range all the time. The VisibleRange carries the current axis range value of the zooming or panning or scrolling state.

How to get axis visible range

You can get the current VisibleRange value of ChartAxis using the VisibleRange property as the code example below.

 

<chart:SfChart x:Name="chart" LayoutUpdated="chart_LayoutUpdated">
       <chart:SfChart.PrimaryAxis>
             <chart:CategoryAxis Interval="2" x:Name="primary" />
       </chart:SfChart.PrimaryAxis>
       ….
 
</chart:SfChart>

 

private void chart_LayoutUpdated(object sender, EventArgs e)
{
     var visibleRange = primary.VisibleRange;
} 

How to get axis actual range

You can get the ActualRange value of ChartAxis with help of ActualRangeChanged event argument values e.ActualMinimum and e.ActualMaximum, which represents start and end range of axis value respectively. The following code example shows how to get axis actual range value.

 

 <chart:SfChart x:Name="chart" >
      <chart:SfChart.PrimaryAxis>
          <chart:CategoryAxis Interval="2" x:Name="primary" ActualRangeChanged="primary_ActualRangeChanged"/>
       </chart:SfChart.PrimaryAxis>
        …. 
 
</chart:SfChart>

 

private void primary_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{
     var primaryActualMin = e.ActualMinimum;
     var primaryActualMax = e.ActualMaximum;
}

 

See Also:


How to specify axis range with padding in UWP

 

How to view specific axis range in real time or dynamic update for UWP

 

How to view axis range with padding in WPF

 

How to view certain axis range while dynamic update in WPF


Conclusion

I hope you enjoyed learning about how to get axis range of chart in UWP.

You can refer to our UWP Chart feature tour page to know about its other groundbreaking feature representations. You can also explore our UWP Chart documentation to understand how to present and manipulate data. 

For current customers, you can check out our UWP components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our UWP Chart and other UWP components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied