or
public class CustomerModel : _BaseModel
{
public int CustomerId { get; set; }
public string CustomerCode { get; set; }
public string CustomerName { get; set; }
public List<
ProjectModel
> Projects { get; set; }
}
public class ProjectModel : _BaseModel
{
public int ProjectId { get; set; }
public int UserId { get; set; }
public int CustomerId { get; set; }
public WarehouseModel PrimaryWarehouse { get; set; }
public WarehouseModel SecondaryWarehouse { get; set; }
public ProjectType ProjectType { get; set; }
public string ProjectName { get; set; }
public string ProjectNum { get; set; }
public DateTime Date { get; set; }
public string Comments { get; set; }
}
<
Window.Resources
>
<
DataTemplate
x:Key
=
"Project"
>
<
TextBlock
Text
=
"{Binding ProjectName}"
/>
</
DataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"Customer"
ItemTemplate
=
"{StaticResource Project}"
ItemsSource
=
"{Binding Customers}"
>
<
TextBlock
Text
=
"{Binding CustomerName}"
/>
</
HierarchicalDataTemplate
>
</
Window.Resources
>
<
telerik:RadTreeView
ItemsSource
=
"{Binding Customers}"
ItemTemplate
=
"{StaticResource Customer}"
/>
SeriesMapping mySeries =
new
SeriesMapping();
mySeries.LegendLabel =
"Current Year Cash Balance"
;
mySeries.SeriesDefinition =
new
SplineSeriesDefinition();
mySeries.SeriesDefinition.Appearance.StrokeThickness = 3;
mySeries.ItemMappings.Add(
new
ItemMapping(
"CashBalance"
, DataPointMember.YValue));
mySeries.ItemMappings.Add(
new
ItemMapping(
"Week"
, DataPointMember.XCategory));
secondaryChart.SeriesMappings.Add(mySeries);
secondaryChart.DefaultSeriesDefinition.ShowItemLabels =
false
;
secondaryChart.ItemsSource = cashBalanceData.Tables[
"currentCashBalance"
];
var chartArea =
new
ChartArea();
chartArea.LegendName =
"test"
;
var pieSeries =
new
DataSeries
{
Definition =
new
PieSeriesDefinition
{
InteractivitySettings =
{HoverScope = InteractivityScope.None,
SelectionScope = InteractivityScope.Item,
SelectionMode = ChartSelectionMode.Single
}
}
};
pieSeries.Definition.ItemLabelFormat =
"p"
;
pieSeries.Add(
new
DataPoint() { YValue = 0.215208267, LegendLabel =
"Toyota"
} );
pieSeries.Add(
new
DataPoint() { YValue = 0.192960612, LegendLabel =
"General Motors"
} );
pieSeries.Add(
new
DataPoint() { YValue = 0.151830229, LegendLabel =
"Volkswagen"
} );
pieSeries.Add(
new
DataPoint() { YValue = 0.125964366, LegendLabel =
"Ford"
} );
pieSeries.Add(
new
DataPoint() { YValue = 0.091152353, LegendLabel =
"Honda"
} );
pieSeries.Add(
new
DataPoint() { YValue = 0.079093251, LegendLabel =
"Nissan"
} );
pieSeries.Add(
new
DataPoint() { YValue = 0.079093251, LegendLabel =
"PSA"
} );
pieSeries.Add(
new
DataPoint() { YValue = 0.064697675, LegendLabel =
"Hyundai"
} );
chartArea.DataSeries.Add(pieSeries);
RadChart1.DefaultView.ChartLegend.UseAutoGeneratedItems =
true
;
RadChart1.DefaultView.ChartArea = chartArea;
RadChart1.DefaultView.ChartLegend.Header =
"Legend test"
;