Graphing controls work in an Xbap?

Jul 16, 2009 at 9:40 PM



I've been trying out the new graphing controls and they seem to work great in the demo app and they render properly when used in VS 2008. However, when I go to run them in an Xbap, I am getting errors. (Not set to an instance of an Object).  Are there any inherit limitations of using the graphing controls in an Xbap? Here is the code snippet of my graph. It is a modifed version of a similiar graph taken from the demo app. And below that, is the class definition for the data source.


                                    Text="Fire Incidents"
                                    Text="(Monthly Trends)"
            <!-- Scores -->
                            Title="Fire Incidents"
                            ItemsSource="{StaticResource FireCallVolumeCollection}"
                            DependentValueBinding="{Binding Volume}">
                    <!-- Axis for automatic sorting and custom labels -->
                            <Style TargetType="chartingToolkit:AxisLabel">
                                <Setter Property="Template">
                                        <ControlTemplate TargetType="chartingToolkit:AxisLabel">
                                            <TextBlock Text="{Binding Month}"/>

namespace FireUIDemo.Views.DashBoard.CallVolumeData
    /// <summary>
    /// Sample class to demo Call Volume Graphs.
    /// </summary>
    class FireCallVolume : IComparable
        public string IncidentType { get; set; }   // EMS, Fire
        public string Month { get; set; }  // Jan, Feb, etc...
        public int Volume { get; set; }    // # of calls.

     public int CompareTo(object obj)
            return string.Compare(Month, (obj as FireCallVolume).Month, StringComparison.OrdinalIgnoreCase);






Jul 17, 2009 at 12:52 AM


I just did File, New Project, WPF Browser Application, add references to DataVisualization and WPFToolkit assemblies, add XAML below, and run - and it worked fine. So I'm thinking the issue may have something to do with something specific you've done in your project. Perhaps if you try to simplify it further the cause will be come apparant? Or alternatively, maybe you could add more to my working sample to try to find what might introduce a problem?

                <Point Y="1"/>
                <Point Y="2"/>
                <Point Y="3"/>
Jul 17, 2009 at 5:13 AM


Thanks for the quick reply! After much searching, I found this link:


I downloaded the "Chart Builder" app, which was really amazing, and it cranks out the code for the chart you define. I basically had to cut and paste that into my own app and it worked! Great tool for learning about this great new feature.