LineSeriesDefinition AG_E_UNKNOWN_ERROR

4 posts, 1 answers
  1. James
    James avatar
    136 posts
    Member since:
    Nov 2008

    Posted 16 Apr 2010 Link to this post

    Hi,

    When I set ShowItemLabels or ShowPointMarks to true I get AG_E_UNKNOWN_ERROR. If I set both to false the exception is not thrown and the line graph shows as expected.

    Here is my code :

            <telerikChart:RadChart x:Name="radChart">  
                <telerikChart:RadChart.SeriesMappings> 
                    <telerikCharting:SeriesMapping> 
                        <telerikCharting:SeriesMapping.SeriesDefinition> 
                            <telerikCharting:LineSeriesDefinition ShowItemLabels="True" /> 
                        </telerikCharting:SeriesMapping.SeriesDefinition> 
                        <telerikCharting:SeriesMapping.ItemMappings> 
                            <telerikCharting:ItemMapping FieldName="LastUpdate" DataPointMember="XValue" /> 
                            <telerikCharting:ItemMapping FieldName="Price" DataPointMember="YValue" /> 
                        </telerikCharting:SeriesMapping.ItemMappings> 
                    </telerikCharting:SeriesMapping> 
                </telerikChart:RadChart.SeriesMappings> 
            </telerikChart:RadChart> 

    Code behind :

            private List<Market> items;  
     
            public MyChart() {  
                InitializeComponent();  
     
                items = new List<Market>();  
     
                var p1 = new Market();  
                p1.Price = 1256.75;  
                p1.LastUpdate = DateTime.Now;  
                items.Add(p1);  
     
                var p2 = new Market();  
                p2.Price = 1236.75;  
                p2.LastUpdate = DateTime.Now.AddDays(1);  
                items.Add(p2);  
     
                var p4 = new Market();  
                p4.Price = 1236.75;  
                p4.LastUpdate = DateTime.Now.AddDays(2);  
                items.Add(p4);  
     
                radChart.DefaultView.ChartArea.AxisX.MinValue = items.FirstOrDefault().LastUpdate.ToOADate();  
                radChart.DefaultView.ChartArea.AxisX.MaxValue = items.LastOrDefault().LastUpdate.ToOADate();  
                radChart.ItemsSource = items;  
            }  
     
            public class Market {  
                public double Price { getset; }  
                public DateTime LastUpdate { getset; }  
            } 

    I am on version 2010.1.0412 SL4 RTW.

    Can you replicate?

    Regards,

    James
  2. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 16 Apr 2010 Link to this post

    Hi James,

    Indeed we must admit that this problem was introduced in the latest unofficial internal build released on Monday. Our developers were able to address the issue immediately and the fix will be included in the weekly internal build that should become public later today.


    All the best,
    Freddie
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. James
    James avatar
    136 posts
    Member since:
    Nov 2008

    Posted 16 Apr 2010 Link to this post

    Thanks that solved the problem, but now this latest build has broken my X axis when AutoRange=True.

    See attached screen shot and code below. The previous internal build did not have this issue.

            <Controls:RadChart x:Name="radChart">  
                <Controls:RadChart.SeriesMappings> 
                    <telerikCharting:SeriesMapping> 
                        <telerikCharting:SeriesMapping.SeriesDefinition> 
                            <telerikCharting:LineSeriesDefinition ShowItemLabels="True" ShowPointMarks="False" /> 
                        </telerikCharting:SeriesMapping.SeriesDefinition> 
                        <telerikCharting:SeriesMapping.ItemMappings> 
                            <telerikCharting:ItemMapping FieldName="LastUpdate" DataPointMember="XValue" /> 
                            <telerikCharting:ItemMapping FieldName="Price" DataPointMember="YValue" /> 
                        </telerikCharting:SeriesMapping.ItemMappings> 
                    </telerikCharting:SeriesMapping> 
                </Controls:RadChart.SeriesMappings> 
                <Controls:RadChart.DefaultView> 
                    <telerikCharting:ChartDefaultView> 
                        <telerikCharting:ChartDefaultView.ChartArea> 
                            <telerikCharting:ChartArea> 
                                <telerikCharting:ChartArea.AxisX> 
                                    <telerikCharting:AxisX AutoRange="True" LayoutMode="Normal" IsDateTime="True" DefaultLabelFormat="hh:mm:ss">  
                                    </telerikCharting:AxisX> 
                                </telerikCharting:ChartArea.AxisX> 
                            </telerikCharting:ChartArea> 
                        </telerikCharting:ChartDefaultView.ChartArea> 
                    </telerikCharting:ChartDefaultView> 
                </Controls:RadChart.DefaultView> 
            </Controls:RadChart> 

    Code behind :

            private List<Market> items;  
     
            public MyChart() {  
                InitializeComponent();  
     
                items = new List<Market>();  
     
                var p1 = new Market();  
                p1.Price = 1256.75;  
                p1.LastUpdate = DateTime.Now;  
                items.Add(p1);  
     
                var p2 = new Market();  
                p2.Price = 1236.75;  
                p2.LastUpdate = DateTime.Now.AddSeconds(20);  
                items.Add(p2);  
     
                var p4 = new Market();  
                p4.Price = 1296.75;  
                p4.LastUpdate = DateTime.Now.AddSeconds(40);  
                items.Add(p4);  
     
                radChart.DefaultView.ChartArea.AxisX.MinValue = items.FirstOrDefault().LastUpdate.ToOADate();  
                radChart.DefaultView.ChartArea.AxisX.MaxValue = items.LastOrDefault().LastUpdate.ToOADate();  
                radChart.ItemsSource = items;  
            }  
     
            public class Market {  
                public double Price { getset; }  
                public DateTime LastUpdate { getset; }  
            } 


    Regards,

    James
  4. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 21 Apr 2010 Link to this post

    Hi James,

    You need to set AxisX.AutoRange property to false in order to be able to set its MinValue, MaxValue and Step. In addition, we recommend using the AddRange method, here is an example:

    double min = items.FirstOrDefault().LastUpdate.ToOADate();
    double max = items.LastOrDefault().LastUpdate.ToOADate();
    radChart.DefaultView.ChartArea.AxisX.AutoRange = false;
    radChart.DefaultView.ChartArea.AxisX.AddRange(min, max, (max - min) / 2);

    Sincerely,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top