Newbie In Need of Help

Thread is closed for posting
2 posts, 0 answers
  1. Ken Cox
    Ken Cox avatar
    101 posts
    Member since:
    Oct 2002

    Posted 11 Dec 2012 Link to this post

    Hi folks,

    Brand new to the Chart control and way out of my depth. I'm not even sure that the chart can do what I want but here goes. I've attached an image showing the ideal chart. (Okay, the shadow's a frill. <grin>)

    I need a chart with two series that displays the XValue (an OADate) as a formatted string and the YValues as a line. The two series will have similar Y data but dissimilar dates. Only the dates that are given should appear - not ranges.

    I've pasted in some sample markup to show what the data looks like. Nothing is working so far so any tips, code, warning or solutions are most welcome.

    <telerik:RadChart runat="server" ID="RadChart2" Skin="LightBrown">
                       <telerik:ChartSeries Name="Vendor One" Type="Line">
                               <telerik:ChartSeriesItem YValue="6000" XValue="41245.211">
                               <telerik:ChartSeriesItem YValue="8000" XValue="41251.44">
                       <telerik:ChartSeries Name="Vendor Two" Type="Line">
                               <telerik:ChartSeriesItem YValue="5000" XValue="41253.345">
                               <telerik:ChartSeriesItem YValue="9000" XValue="41254.72315">
                       <XAxis >
                               <LabelAppearance RotationAngle="70"></LabelAppearance>
                       <YAxis AxisMode="Extended">
                       <TextBlock Text="Chart Problem">
  2. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 14 Dec 2012 Link to this post

    Hi Ken,

    The code that you have posted seems correct. Here are a couple of tips that should help you configure the chart control in order to get the result that you need:
    • To make the RadChart interpret the OADate values as DateTime, you need to set
      RadChart1.PlotArea.XAxis.Appearance.ValueFormat = ChartValueFormat.ShortDate;
    • Also you need to set XAxis IsZeroBased to false

    Additionally, you can improve the RadChart appearance by:
    • Setting RadChart.AutoLayout to true
    • Setting RadChart.Appearance.TextQuality to AntiAlias

    As for the shadow you can try the following: 
    <telerik:ChartSeries Name="Vendor One" Type="Line">
        <Appearance LineSeriesAppearance-Width="5">
            <Shadow Color="#808080" Distance="5" Blur="2"/>

    Petar Kirov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top