Controlling the width of the datapoint plot area in RadCartesianChart

4 posts, 0 answers
  1. Claus
    Claus avatar
    1 posts
    Member since:
    Oct 2012

    Posted 13 Feb 2013 Link to this post

    Controlling the width of the datapoint plot area in RadCartesianChart


    I am currently developing a simple bar chart showing a variable number of bar columns.

    Now, I have used the PointTemplate property to set the bar columns at the same size regardless of the number of data points:

             <Grid Width="80">
                 <Border Background="#FF817661" CornerRadius="5" Margin="23,5,23,0"/>

    My problem is that when I have few data points I want the bar columns aligned to the left like this:

    |    **     
    |    **
    |    **
    |    **         **
    |    **         **
    |    **         **
    |    **         **
    |    **         **
    |    **         **
    |    **         **
    |    **         **

    But the chart control always distributes the data point plot areas evenly across the control space like this.

    |            **     
    |            **
    |            **
    |            **                         **
    |            **                         **
    |            **                         **
    |            **                         **
    |            **                         **
    |            **                         **
    |            **                         **
    |            **                         **

    I would really like to know how I can achieve the result on the top figure. How can I control the width of the plot area/container that holds the bar columns.
    Either it must be totally obvious or it is simply not possible, as I cannot google my way to an answer.

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 18 Feb 2013 Link to this post

    Hi Claus,

    You can specify manual range for linear axes using the Minimum and Maximum properties. For additional information, please refer to our online documentation.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Smitha
    Smitha avatar
    1 posts
    Member since:
    Sep 2013

    Posted 04 Sep 2013 Link to this post

    Even i'm facing the same problem.
    I'm currently working on plotting a live data, which i get it from a device at every second..

      Here is the xaml part of it
    <telerik:RadCartesianChart   x:Name="chart" >
                                  <telerik:DateTimeContinuousAxis FontSize="16" Title="Time(sec)" ShowLabels="False" MajorStepUnit="Second"
                                                    LabelFormat="HH:mm:ss" FontFamily="Segoe UI"
                                                    PlotMode="OnTicksPadded" />
                   <telerik:LinearAxis Minimum="50" Maximum="200" MajorStep="10" Title="SPO2(%)"  FontSize="16" />
                                   <telerik:LineSeriess  CategoryBinding="Date" ValueBinding="Value"
                                       ItemsSource="{Binding Data,Mode=TwoWay}">
    Graph1 shows the output,but I want the output to be in the form of graph2.

    Like if there are few points say 2 o 3 the line plots at the centre instead of that i wanted it to plot from the left,
    even after setting minimum and maximum for horizontal axis I hav the same problem..
    I would be glad if u provide a solution for this..

    Please find the attached graph1 and graph2
  5. Ves
    Ves avatar
    2870 posts

    Posted 09 Sep 2013 Link to this post

    Hi Smitha,

    Your code snippet actually shows Minimum And Maximum properties set for the vertical axis, but not for the horizontal one. Please, set the DateTimeContinuousAxis.Minimum and Maximum properties.

    Best regards,
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top