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

LineSeriesDefinition AG_E_UNKNOWN_ERROR

3 Answers 36 Views
Chart
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 16 Apr 2010, 11:26 AM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 16 Apr 2010, 01:01 PM
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.
0
James
Top achievements
Rank 1
answered on 16 Apr 2010, 09:06 PM
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
0
Ves
Telerik team
answered on 21 Apr 2010, 08:17 AM
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.
Tags
Chart
Asked by
James
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
James
Top achievements
Rank 1
Ves
Telerik team
Share this question
or