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

IsDateTime Bug

1 Answer 37 Views
Chart
This is a migrated thread and some comments may be shown as answers.
gillou01
Top achievements
Rank 1
gillou01 asked on 15 Apr 2009, 09:40 AM
Hi,
i am using this string to create on the fly a chart and when i use the
XamlReader.Load(result)
there is a error message on the IsDateTime attribute.

Could someone have a look?

Here is the string i use:

<control:RadChart Name="RadChart1" Width="499" Height="258">
    <control:RadChart.DefaultView>
      <chart:ChartDefaultView>
        <chart:ChartDefaultView.ChartArea>
          <chart:ChartArea>
            <chart:ChartArea.DataSeries>
              <chart:DataSeries Label="Serie1">
                <chart:DataSeries.Definition>
                  <chart:BarSeriesDefinition />
                </chart:DataSeries.Definition>
                <chart:DataPoint XValue="39425" YValue="3033" />
                <chart:DataPoint XValue="39426" YValue="2589" />
                <chart:DataPoint XValue="39427" YValue="2370" />
              </chart:DataSeries>
              <chart:DataSeries Label="Serie2">
                <chart:DataSeries.Definition>
                  <chart:LineSeriesDefinition />
                </chart:DataSeries.Definition>
                <chart:DataPoint XValue="39425" YValue="21" />
                <chart:DataPoint XValue="39426" YValue="23" />
                <chart:DataPoint XValue="39427" YValue="24" />
              </chart:DataSeries>
              <chart:DataSeries Label="Serie3">
                <chart:DataSeries.Definition>
                  <chart:SplineSeriesDefinition />
                </chart:DataSeries.Definition>
                <chart:DataPoint XValue="39425" YValue="15" />
                <chart:DataPoint XValue="39426" YValue="12" />
                <chart:DataPoint XValue="39427" YValue="10" />
              </chart:DataSeries>
            </chart:ChartArea.DataSeries>
            <chart:ChartArea.AxisX>
              <chart:AxisX DefaultFormat="MM/dd/yy" IsDateTime="True" />
            </chart:ChartArea.AxisX>
          </chart:ChartArea>
        </chart:ChartDefaultView.ChartArea>
      </chart:ChartDefaultView>
    </control:RadChart.DefaultView>
  </control:RadChart>


Cheers


1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 16 Apr 2009, 01:28 PM
Hi gillou01,

Unfortunately we must confirm this is a bug within the control. We have logged it in our bugtracking system and it will be fixed for the next official version of the control. Meanwhile, we could suggest you as a workaround not to create the AxisX instance declaratively but set its properties from code like this:

            RadChart chart = XamlReader.Load(@" 
<control:RadChart  
    xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""  
    xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""  
    xmlns:control=""clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting""  
    xmlns:chart=""clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"" 
    Name=""RadChart1"" Width=""499"" Height=""258""> 
    <control:RadChart.DefaultView> 
      <chart:ChartDefaultView> 
        <chart:ChartDefaultView.ChartArea> 
          <chart:ChartArea> 
            <chart:ChartArea.DataSeries> 
              <chart:DataSeries Label=""Serie1""> 
                <chart:DataSeries.Definition> 
                  <chart:BarSeriesDefinition /> 
                </chart:DataSeries.Definition> 
                <chart:DataPoint XValue=""39425"" YValue=""3033"" /> 
                <chart:DataPoint XValue=""39426"" YValue=""2589"" /> 
                <chart:DataPoint XValue=""39427"" YValue=""2370"" /> 
              </chart:DataSeries> 
              <chart:DataSeries Label=""Serie2""> 
                <chart:DataSeries.Definition> 
                  <chart:LineSeriesDefinition /> 
                </chart:DataSeries.Definition> 
                <chart:DataPoint XValue=""39425"" YValue=""21"" /> 
                <chart:DataPoint XValue=""39426"" YValue=""23"" /> 
                <chart:DataPoint XValue=""39427"" YValue=""24"" /> 
              </chart:DataSeries> 
              <chart:DataSeries Label=""Serie3""> 
                <chart:DataSeries.Definition> 
                  <chart:SplineSeriesDefinition /> 
                </chart:DataSeries.Definition> 
                <chart:DataPoint XValue=""39425"" YValue=""15"" /> 
                <chart:DataPoint XValue=""39426"" YValue=""12"" /> 
                <chart:DataPoint XValue=""39427"" YValue=""10"" /> 
              </chart:DataSeries> 
            </chart:ChartArea.DataSeries> 
          </chart:ChartArea> 
        </chart:ChartDefaultView.ChartArea> 
      </chart:ChartDefaultView> 
    </control:RadChart.DefaultView> 
  </control:RadChart> 
") as RadChart; 
 
            chart.DefaultView.ChartArea.AxisX.DefaultFormat = "MM/dd/yy"
            chart.DefaultView.ChartArea.AxisX.IsDateTime = true
 
            LayoutRoot.Children.Add(chart); 


Sorry for the inconvenience. We have updated your Telerik points for the report.


Sincerely yours,
Manuel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Chart
Asked by
gillou01
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or