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

Newbie In Need of Help

1 Answer 16 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
kencox
Top achievements
Rank 1
kencox asked on 12 Dec 2012, 05:46 AM
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.

Ken
<telerik:RadChart runat="server" ID="RadChart2" Skin="LightBrown">
               <Series>
                   <telerik:ChartSeries Name="Vendor One" Type="Line">
                       <Items>
                           <telerik:ChartSeriesItem YValue="6000" XValue="41245.211">
                           </telerik:ChartSeriesItem>
                           <telerik:ChartSeriesItem YValue="8000" XValue="41251.44">
                           </telerik:ChartSeriesItem>
 
                       </Items>
                   </telerik:ChartSeries>
                   <telerik:ChartSeries Name="Vendor Two" Type="Line">
                       <Items>
                           <telerik:ChartSeriesItem YValue="5000" XValue="41253.345">
                           </telerik:ChartSeriesItem>
                           <telerik:ChartSeriesItem YValue="9000" XValue="41254.72315">
                           </telerik:ChartSeriesItem>
                       </Items>
                   </telerik:ChartSeries>
               </Series>
               <PlotArea>
                   <XAxis >
                       <Appearance>
                           <LabelAppearance RotationAngle="70"></LabelAppearance>
                       </Appearance>
                   </XAxis>
                   <YAxis AxisMode="Extended">
                   </YAxis>
               </PlotArea>
               <ChartTitle>
                   <TextBlock Text="Chart Problem">
                   </TextBlock>
               </ChartTitle>
           </telerik:RadChart>

1 Answer, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 14 Dec 2012, 05:22 PM
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"/>


Greetings,
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.
Tags
Chart (Obsolete)
Asked by
kencox
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Share this question
or