This is a migrated thread and some comments may be shown as answers.

Controlling the width of the datapoint plot area in RadCartesianChart

3 Answers 285 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Claus
Top achievements
Rank 1
Claus asked on 13 Feb 2013, 12:10 PM
Controlling the width of the datapoint plot area in RadCartesianChart

Hi

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:

<telerik:BarSeries.PointTemplate>
     <DataTemplate>
         <Grid Width="80">
             <Border Background="#FF817661" CornerRadius="5" Margin="23,5,23,0"/>
         </Grid>
     </DataTemplate>
</telerik:BarSeries.PointTemplate>


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.

Thanks
Claus

3 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 18 Feb 2013, 12:32 PM
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,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Smitha
Top achievements
Rank 1
answered on 05 Sep 2013, 04:51 AM
Hi,
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:RadCartesianChart.HorizontalAxis>
                              <telerik:DateTimeContinuousAxis FontSize="16" Title="Time(sec)" ShowLabels="False" MajorStepUnit="Second"
                                                LabelInterval="1"
                                                LabelFormat="HH:mm:ss" FontFamily="Segoe UI"
                                                PlotMode="OnTicksPadded" />
                           </telerik:RadCartesianChart.HorizontalAxis>
           <telerik:RadCartesianChart.VerticalAxis>
               <telerik:LinearAxis Minimum="50" Maximum="200" MajorStep="10" Title="SPO2(%)"  FontSize="16" />
           </telerik:RadCartesianChart.VerticalAxis>
           <telerik:RadCartesianChart.Series>
                               <telerik:LineSeriess  CategoryBinding="Date" ValueBinding="Value"
                                   ItemsSource="{Binding Data,Mode=TwoWay}">
                          </telerik:LineSeries>
       </telerik:RadCartesianChart>
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
0
Ves
Telerik team
answered on 09 Sep 2013, 03:12 PM
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,
Ves
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
Tags
ChartView
Asked by
Claus
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Smitha
Top achievements
Rank 1
Ves
Telerik team
Share this question
or