Hi,
Please see below screenshot.
I have a requirement like this case: http://ko.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,
Thank you for your post. I have been looking into it and it seems like that the screenshot wasn’t upload, so could you please try to re-attach it and also it will be great if you could send us an isolated sample project, where the issue is reproduced, so we can investigate it further for you.
Looking forward for your reply.
Hello Stefan,
Thanks for your response, I have re-attached the screenshot. You can see the value of year 2012 is missing
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.
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.