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

BarSeries Linear Axis

7 Answers 155 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 1
Charlie asked on 07 Nov 2013, 08:42 PM
How can I display a BarSeries with a linear axis on the horizontal?

My application needs to display columns along an x axis that is fixed from 0 to 100.

7 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 12 Nov 2013, 03:37 PM
Hello Charlie,

You can use a scatter point series with a point template that looks exactly like a Bar Series, i.e. having a Linear Horizontal Axis.
 For the purpose you can render the scatter points as lines originating from the X axis with Width set per your own scenario needs:
<telerik:ScatterPointSeries.PointTemplate>
 
             <DataTemplate>
 
                        <Canvas Width="2" Height="2">
 
                            <Rectangle Width="2" Height="2000" Fill="Blue"/>
 
                        </Canvas>
 
             </DataTemplate>
 
</telerik:ScatterPointSeries.PointTemplate>

Let me know how this works for you and whether you need any further assistance.

Regards,
Evgenia
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 >>
0
Charlie
Top achievements
Rank 1
answered on 14 Nov 2013, 03:40 PM
Thank you, this works as needed.
0
Andrew
Top achievements
Rank 1
answered on 22 Aug 2018, 02:39 AM
This solution combined with ClipToPlotArea="False" produces lines that stretch beyond one of the axis. Is there a way to set height dynamically so lines only until axis? I tried YValue binding but the lines were shorter then they should be.
0
Martin Ivanov
Telerik team
answered on 23 Aug 2018, 08:44 AM
Hello Andrew,

A possible approach to resolve this is to use an IValueConverter to calculate a Height for the Rectangle in the PointTemplate. I've prepared a small example showing this approach. Can you please give it a try and let me know how it goes?

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andrew
Top achievements
Rank 1
answered on 23 Aug 2018, 12:09 PM
Thanks! This example works when window is a fixed size. Is there a way to add a binding to point template to update it based on chart size?
0
Martin Ivanov
Telerik team
answered on 23 Aug 2018, 07:10 PM
Hi Andrew,

To achieve your requirement also on size changed of the chart, you can use a bit different approach. I've shown this in the attached project. I hope it helps.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andrew
Top achievements
Rank 1
answered on 23 Aug 2018, 07:55 PM
Thanks!
Tags
ChartView
Asked by
Charlie
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Charlie
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or