RadCartesianChart not working

4 posts, 0 answers
  1. Priya
    Priya avatar
    1 posts
    Member since:
    Mar 2014

    Posted 05 Mar 2014 Link to this post


    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>
  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 07 Mar 2014 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. kumu
    kumu avatar
    3 posts
    Member since:
    Mar 2014

    Posted 20 Mar 2014 in reply to Martin Link to this post

    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!! :)
  5. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 20 Mar 2014 Link to this post

    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.

     
Back to Top