Hi, I want to achieve one requirement just like this example: http://es.infragistics.com/products/silverlight/sample/data-chart/#/axis-label-templates
In this example, the Label of CategoryXAxis has an angle, and the Label Template is defined in Resource. But in my application, the xamDataChart is dynamic created in code behind including the CategoryXAxis
Below is my xamdatachart code in xaml:
<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" x:Class="CH.Web.Chart.WEB.XytUcMapMD03Tilt" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="640" xmlns:ig="http://schemas.infragistics.com/xaml">
<Grid x:Name="LayoutRoot">
<ig:XamDataChart x:Name="DataChart1" > </ig:XamDataChart> </Grid></UserControl>
I don't know how to achieve this in code behind(C#). Thanks in advance~~
Hi Maria,
I have resolved my problem. Thanks~
Charlie,
I am just checking if you require any further assistance regarding labels' templates.
Hello Charlie,
Thank you for posting!
If I have understood your scenario correctly, you need to create and apply the DataTemplate for the Labels in code behind. There are a couple of approaches that might be helpful in this case. One of them is to define the template in the resources of your page (using the code form the sample) and access it at run time (page.Resources[object key]). Another one would be creating the template at runtime. Here you will find additional information on creating data templates at runtime.
Please feel free to ask if you have any questions.