Search code examples
c#wpfteleriklineseries

telerik wpf line series how to start line series chart from left to right for real time purpose


I am working on telerik RadCartesianChart, where I am binding Line series, I want to make its label (categorical) should be fixed, Now its moving with the value. And how to run this from left to right.

See the attached image for more clarification.

Image


Solution

  • Xaml code:-

    <telerik:RadCartesianChart HorizontalAlignment="Left" VerticalAlignment="Top" Height="230" Width="437" x:Name="chart3" MouseUp="chart_MouseUp" Tag="{Binding 
                      ElementName=chart3}">
      <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="Y" MajorXLineDashArray="10,5" MajorYLinesRenderMode="All">
        </telerik:CartesianChartGrid>
      </telerik:RadCartesianChart.Grid>
    </telerik:RadCartesianChart>
    

    c#(Backend code) to set fixed value:

    chart1.VerticalAxis = new LinearAxis() { Maximum = 100, Minimum = 0 };
    chart1.HorizontalAxis = new LinearAxis() { Maximum = 30, Minimum = 0 };