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

RadCartesianChart not working

3 Answers 166 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Priya
Top achievements
Rank 1
Priya asked on 05 Mar 2014, 12:37 PM

0
down vote

I am very new to RadCartesianChart.I created a chart in wpf using below code.I got empty screen when i execute.I want to add any property in RadCartesianChart.HorizontalAxis or RadCartesianChart.VerticalAxis .Am I missed anything.Please help me.

<Window x:Class="LineChart.TwoVerticalAxes"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="TwoVerticalAxes" Height="300" Width="300">
<Grid>
<telerik:RadCartesianChart>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis />
</telerik:RadCartesianChart.HorizontalAxis>

<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Maximum="100" ElementBrush="Orange"/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Series>
<telerik:LineSeries Stroke="Orange" StrokeThickness="2">
<telerik:LineSeries.DataPoints>
<telerik:CategoricalDataPoint Value="20"/>
<telerik:CategoricalDataPoint Value="40"/>
<telerik:CategoricalDataPoint Value="35"/>
<telerik:CategoricalDataPoint Value="40"/>
<telerik:CategoricalDataPoint Value="30"/>
<telerik:CategoricalDataPoint Value="50"/>
</telerik:LineSeries.DataPoints>
</telerik:LineSeries>

<telerik:LineSeries Stroke="Blue" StrokeThickness="2">
<telerik:LineSeries.VerticalAxis>
<telerik:LinearAxis HorizontalLocation="Right" ElementBrush="Blue" />
</telerik:LineSeries.VerticalAxis>
<telerik:LineSeries.DataPoints>
<telerik:CategoricalDataPoint Value="30"/>
<telerik:CategoricalDataPoint Value="20"/>
<telerik:CategoricalDataPoint Value="15"/>
<telerik:CategoricalDataPoint Value="50"/>
<telerik:CategoricalDataPoint Value="20"/>
<telerik:CategoricalDataPoint Value="60"/>
</telerik:LineSeries.DataPoints>
</telerik:LineSeries>
</telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>
</Grid>
</Window>

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 07 Mar 2014, 05:04 PM
Hello Priya,

I was not able to reproduce the behavior that you described using the normal WPF Telerik binaries. However, please note that if you're using the NoXaml version of our assemblies, you will have to manually add styles and ControlTemplates for the RadCartasianChart. Please examine the Setting a Theme (Using Implicit Styles) tutorial for more information on the matter.

Also for your convenience I attached a sample project using the XAML definitions you provided us with.

Regards,
Martin
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
kumu
Top achievements
Rank 1
answered on 20 Mar 2014, 07:45 AM
Martin,
    am creating a Line series chat with RadCartesianChart in WPF application. iam struggling to assign source to it. can u please give a sample application for it.

Thanks in Advance!! :)
0
Martin Ivanov
Telerik team
answered on 20 Mar 2014, 03:59 PM
Hi Kumu,

You can read more about the chart features in our help. You can also take a look at our SDK in GitHub where you can find examples of the charting components. Or you can download our UI for WPF demos and examine the ChartView samples.

Note that the RadCartesianChart itself doesn't have an ItemsSource, instead you can bind a collection to the ItemsSource property of any of the chart's series.

For your convenience I also attached a sample project which demonstrates the use of a RadCartesianChart in a simple MVVM scenario.

Regards,
Martin
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Chart
Asked by
Priya
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
kumu
Top achievements
Rank 1
Share this question
or