MindFusion.Reporting for Silverlight Programmer's Guide
PieChart Class
Remarks See Also
 





Renders a bound dataset as a pie chart.

Namespace: MindFusion.Reporting.Silverlight
Assembly: MindFusion.Reporting.Silverlight

 Syntax

C#  Copy Code

public class PieChart : ChartReportItem

Visual Basic  Copy Code

Public Class PieChart
    Inherits ChartReportItem

 Remarks

The pie chart displays the data specified by the DataSource property. If DataSource is null (Nothing in Visual Basic) the PieChart raises the QueryDetails event of its containing report passing its DataContext as a master row and uses the return IEnumeration as data source. If QueryDetails did not yield any details, the DataContext is used as a data source.

The TargetMember property specifies the property of the objects in the data source, which will be used for pie plotting.

 Example

Let Simple is a class defined as following:

C#  Copy Code

public class Simple
{
    public int IntField
    {
        get;
        set;
    }

    public string StringField
    {
        get;
        set;
    }
}

Visual Basic  Copy Code

Public Class Simple

    Public Property IntField() As Integer

        Get
            Return _intField
        End Get
        Set(ByVal value As Integer)
            _intField = value
        End Set

    End Property

    Public Property StringField() As String

        Get
            Return _stringField
        End Get
        Set(ByVal value As String)
            _stringField = value
        End Set

    End Property


    Private _intField As Integer
    Private _stringField As String

End Class

Let us have the following static definition of an array of Simple objects, defined in XAML:

XAML  Copy Code

<x:ArrayExtension Type="{x:Type l:Simple}" x:Key="data">
  <l:Simple IntField="1" StringField="Item #1" />
  <l:Simple IntField="15" StringField="Item #2" />
  <l:Simple IntField="32" StringField="Item #3" />
  <l:Simple IntField="44" StringField="Item #4" />
  <l:Simple IntField="28" StringField="Item #5" />
  <l:Simple IntField="61" StringField="Item #6" />
</x:ArrayExtension>

Then we can define a simple PieChart showing the above array as following:

XAML  Copy Code

<r:PieChart DataContext="{StaticResource data}" TargetMember="IntField" Size="200,200" PieStroke="Black" PieStrokeThickness="1" />

 Inheritance Hierarchy

System.Object
    System.Windows.DependencyObject
        System.Windows.UIElement
            System.Windows.FrameworkElement
                MindFusion.Reporting.Silverlight.ReportItem
                    MindFusion.Reporting.Silverlight.PieChart

 See Also

PieChart Members
MindFusion.Reporting.Silverlight Namespace