Hi,
Please see below screenshot.
I have a requirement like this case: http://es.infragistics.com/community/forums/t/54197.aspx, and I achieve this in code-behind, but now there is a problem here. Some value on top of ColumnSeries are missing, is there any property need to set to avoid this situation. Thanks in advance
Below is my code behind:
ColumnSeries series = new ColumnSeries();series.ValueMemberPath = "Y";series.Thickness = 3;series.XAxis = _xAxis;
//show value on top of columnSeriesDataTemplate dt = new DataTemplate();dt = (DataTemplate)XamlReader.Load("<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> <TextBlock Text='{Binding Item.Y}' Margin='0,0,0,20'/> </DataTemplate>");series.MarkerTemplate = dt;
Hello Charlie,
This is a limitation in Silverlight. You are not able to get visual elements by their x:Name when they are placed inside a collection.
Hello Stefan,
Thanks for your solution, it's OK.
((NumericYAxis)(xmDataChart.Axes["xmTemYAxis"])).MaximumValue = bindingList.Max(x => x.Tem) + 10;
But as mentioned in my last post, I still don't understand why one of them is null, anothe isn't null.
You can try to get the Axis by using the XamDataChart's Axes collection like this:
xmDataChart.Axes["xmTemYAxis"] as NumericYAxis
Hope this helps you.
I tried to use code behind, but I got some trouble. Please see below code:
Xaml code:
<ig:XamDataChart x:Name="xmDataChart" Margin="6,5,6,0" Legend="{Binding ElementName=xmLegend}">
......
<ig:NumericYAxis x:Name="xmTemYAxis"> <ig:NumericYAxis.LabelSettings> <ig:AxisLabelSettings Location="OutsideLeft" Extent="50"/> </ig:NumericYAxis.LabelSettings> </ig:NumericYAxis>
Code-behind (C#):
xmTemYAxis.MaximumValue = bindingList.Max(x => x.Tem) + 10;
xmDataChart.DataContext = bindingList;
The application build successfully, but when debugging, throw a NullReferenceException, I find that "xmTemYAxis" is null, but the "xmDataChart" isn't null. I don't know why one of them is null, anothe isn't null.
Do I make it clear?
Thanks in advance!
You can use code behind in order to find the biggest value and set the axis' MaxValue to a bigger one.