Using ActualInterval properties of AxisX and AxisY

In this topic, we will explain how to obtain the actual interval of axis which are calculated by Visifire internally. ActualInterval will be available once the chart is rendered. Lets follow the example below.

 

The XAML for chart  is as shown below:

 

<vc:Chart Theme="Theme1" x:Name="MyChart" Width="400" Height="300">

 

    <vc:Chart.Titles>

        <vc:Title Text="Visifire"/>

    </vc:Chart.Titles>            

            

    <vc:Chart.Series>

        <vc:DataSeries RenderAs="Column" MarkerSize="8" >

            <vc:DataSeries.DataPoints>

                <vc:DataPoint AxisXLabel="Sun" YValue="30"/>

                <vc:DataPoint AxisXLabel="Mon" YValue="20"/>

                <vc:DataPoint AxisXLabel="Tue" YValue="15"/>

                <vc:DataPoint AxisXLabel="Wed" YValue="10"/>

                <vc:DataPoint AxisXLabel="Thu" YValue="30"/>

                <vc:DataPoint AxisXLabel="Thu" YValue="40"/>                     

            </vc:DataSeries.DataPoints>

        </vc:DataSeries>

    </vc:Chart.Series>   

</vc:Chart>

 

Attach a Rendered event to Chart in Page constructor as shown below.

 

 

MyChart.Rendered += new EventHandler(MyChart_Rendered);

 

 

Following is the event handler for Rendered event.

 

void MyChart_Rendered(object sender, EventArgs e)

{

  // ActualInterval will be available once the chart is rendered

  MessageBox.Show("ActualInterval of AxesX= " +        MyChart.AxesX[0].ActualInterval.ToString());

}

 

Below is the screen shot of the chart:

 

actualinterval.jpg