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

Binding

1 Answer 118 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fredrick Bartlett
Top achievements
Rank 1
Fredrick Bartlett asked on 04 Jun 2011, 12:15 AM
I am binding a chart series to a collection of business objects. However my yAxis(Value) series does not display. Also, what is the correct control for the xAxis if the Category type is double? Categorical, Linear... 
Is there any documentation? The samples are not helpful for understanding binding MVVM implementation.

Business Object

    public class ChartBusinessObject
    {
        public int? Value { get; set; }
        public double Category { get; set; }

        public ChartBusinessObject()
        {
            Value = -1;
            Category = -1;
        }
    }

ViewModel

        public List<ChartBusinessObject> ChartDataItemPit1
        {
            get
            {
                return _chartdataitempit1;
            }

            set
            {
                if (_chartdataitempit1 != value)
                {
                    _chartdataitempit1 = value;
                    RaisePropertyChanged("ChartDataItemPit1");
                }
            }
        }

xaml
            <telerikChart:SplineSeries PointTemplateSelector="{StaticResource series1PointSelector}"
                                     Stroke="{StaticResource Series1Brush}"
                                     StrokeThickness="2"
                                     PointLength="8"
                                     ClipToPlotArea="False"
                                     ItemsSource="{Binding Path=ChartDataItemPit1}">
                <telerikChart:SplineSeries.ValueBinding>
                    <telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>
                </telerikChart:SplineSeries.ValueBinding>
                <telerikChart:SplineSeries.CategoryBinding>
                    <telerikChart:PropertyNameDataPointBinding PropertyName="Category"/>
                </telerikChart:SplineSeries.CategoryBinding>
            </telerikChart:SplineSeries>

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 08 Jun 2011, 04:34 PM
Hi Fredrick,

Thank you very much for using RadChart and for your feedback.

There is bug with our MVVM data-binding mechanism and Nullable types. We will fix the problem for the upcoming BETA when we are planning to add support for Empty (null value) data points.

Currently supported are only Categorical series, which expect a Categorical (or a DateTime) axis to be specified in order to be correctly plotted. For the official release we will add the so called "Scatter" series - ScatterLine, ScatterArea, etc., which will be plotted by two linear axes.

We are just completing the chart documentation and it should be available on-line tomorrow. We also plan to add a Design-time Chart Gallery, which will allow you to select a predefined chart template to start from.

I have added 1000 Telerik points to your account for bringing our attention to the bug with Nullable types. Please, do not hesitate to contact us with any question/problem you may have - we will be glad to help.

Best wishes,
Georgi
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Chart
Asked by
Fredrick Bartlett
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or