When I assigned values to AxisX.Title and AxisY.Title, these values do not get displayed when I run the program. Here is a sample of my XAML code, GDF and OPTIME does not get displayed:
<
telerik:RadChart Width="299" Height="299" ItemsSource="{Binding Path=ConditionIndicatorDataPoints}">
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartTitle>
<telerik:ChartTitle Content="{Binding Path=ChartName}" />
</telerik:ChartDefaultView.ChartTitle>
<telerik:ChartDefaultView.ChartLegend>
<telerik:ChartLegend Header="GDF"/>
</telerik:ChartDefaultView.ChartLegend>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea PlotAreaStyle="{StaticResource customStyle}">
<telerik:ChartArea.AxisY>
<telerik:AxisY Title="GDF" Visibility="Visible" AxisStyles="{DynamicResource customAxisTitleStyle}" />
</telerik:ChartArea.AxisY>
<telerik:ChartArea.AxisX>
<telerik:AxisX Title="OPTIME" Visibility="Visible" AxisStyles="{DynamicResource customAxisTitleStyle}" />
</telerik:ChartArea.AxisX>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition />
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping DataPointMember="YValue" FieldName="YPlotPoint" />
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
12 Answers, 1 is accepted
I just created an example, based you your xaml and the chart seems to work fine for me. You can find this example attached. Give it a try and let me know if you can see the axis titles.
I have removed the axis styles like this one: AxisStyles="{DynamicResource customAxisTitleStyle}" and it seems this might be the reason for showing the titles in my example. Please, check all the styles you use and verify that the axis titles are not hidden in them.
Regards,
Ves
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
1. It is not in XAML, but instead using code-behind.
2. the problem is with AxisX.Title and AxisY.Title, the bug is not with XCategory. You avoid using AxisX.Title and
AxisY.Title in your sample, while at the same time using XCategory that does not interest Sikorsky.
Sikorsky would like to title the x-axis and the y-axis of our charts using XAML, and this feature of Telerik RadChart is not working since the release of internal build 821. Here is a sample of the XAML code again, and again GDF and OPTIME is not displayed when the code execute, I would like to see them displayed using XAML:
<
telerik:RadChart x:Name="radChartTemplate" Width="299" Height="299">
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartTitle>
<telerik:ChartTitle Content="{Binding Path=ChartName, Mode=OneWay}" />
</telerik:ChartDefaultView.ChartTitle>
<telerik:ChartDefaultView.ChartLegend>
<telerik:ChartLegend Header="Mechanical"/>
</telerik:ChartDefaultView.ChartLegend>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea PlotAreaStyle="{StaticResource customStyle}">
<telerik:ChartArea.AxisY>
<telerik:AxisY Title="GDF"/>
</telerik:ChartArea.AxisY>
<telerik:ChartArea.AxisX>
<telerik:AxisX Title="OPTIME"/>
</telerik:ChartArea.AxisX>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition />
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping DataPointMember="YValue" FieldName="YPlotPoint" PresentationTraceSources.TraceLevel="High"/>
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
I am sorry, it seems I have attached the wrong example. I have now attached the correct one, it uses code-behind only to compose the datasource, hope it's not a problem as it does not seem to be related to the issue itself. Once again - please, check the axis styles you use and let us know how it goes.
Greetings,
Ves
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Hi guys,
The chartaxes.zip sample that you sent me helps, it worked. I ignore to tell you that I was using Telerik chart in a ItemsControl, in my case a ListBox. When I take the chart XAML in your sample and places it in a ListBox, all the text in the chart turns black, including the axises titles. With a black background and black foreground the text in the chart appears to disappear. However, I was able to get around this by setting the ListBox Foreground property to white. Thanks again for your help!
<
ListBox Foreground="White">
<ListBoxItem>
<telerik:RadChart x:Name="RadChart1" Width="299" Height="299">
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartTitle>
<telerik:ChartTitle Content="Title" />
</telerik:ChartDefaultView.ChartTitle>
<telerik:ChartDefaultView.ChartLegend>
<telerik:ChartLegend Header="GDF"/>
</telerik:ChartDefaultView.ChartLegend>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea >
<telerik:ChartArea.AxisY>
<telerik:AxisY Title="GDF" Visibility="Visible" />
</telerik:ChartArea.AxisY>
<telerik:ChartArea.AxisX>
<telerik:AxisX Title="OPTIME" Visibility="Visible" />
</telerik:ChartArea.AxisX>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition />
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping DataPointMember="YValue" FieldName="YPlotPoint" />
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
</ListBoxItem>
</ListBox>
<
ListBox Foreground="White">
<ListBoxItem>
<telerik:RadChart x:Name="RadChart1" Width="299" Height="299">
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartTitle>
<telerik:ChartTitle Content="Title" />
</telerik:ChartDefaultView.ChartTitle>
<telerik:ChartDefaultView.ChartLegend>
<telerik:ChartLegend Header="GDF"/>
</telerik:ChartDefaultView.ChartLegend>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea >
<telerik:ChartArea.AxisY>
<telerik:AxisY Title="{Binding Path=YAxisT}" Visibility="Visible" />
</telerik:ChartArea.AxisY>
<telerik:ChartArea.AxisX>
<telerik:AxisX Title="{Binding Path=XAxisT}" Visibility="Visible" />
</telerik:ChartArea.AxisX>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition />
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping DataPointMember="YValue" FieldName="YPlotPoint" />
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
</ListBoxItem>
</ListBox>
I am afraid you will not be able to databind AxisX.Title and AxisY.Title as AxisX and AxisY are not dependency objects, so binding is not available.Please, accept our apologies for the inconvenience caused.
Best regards,
Ves
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I am afraid this change is not currently in our plans. I will make sure it is discussed on the next meeting dedicated to chart features, but I am not able to provide you with a certain time frame for the moment. Once again, I apologize for the inconvenience caused.
Kind regards,
Ves
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
<
Style x:Key="conditionIndicatorItemControlTemplate" TargetType="{x:Type ListBox}">
<Setter Property="IsSynchronizedWithCurrentItem" Value="True" />
<Setter Property="Foreground" Value="White" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel></WrapPanel>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Width="Auto" Height="Auto">
<telerik:RadChart x:Name="radChartTemplate" Width="299" Height="299" ItemsSource="{Binding Path=DataPointCollection}">
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartTitle>
<telerik:ChartTitle Content="{Binding Path=ConditionIndicatorName}" />
</telerik:ChartDefaultView.ChartTitle>
<telerik:ChartDefaultView.ChartLegend>
<telerik:ChartLegend Header="{Binding Path=YAxisTitle}"/>
</telerik:ChartDefaultView.ChartLegend>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea PlotAreaStyle="{StaticResource customStyle}">
<telerik:ChartArea.AxisY>
<telerik:AxisY Title="{Binding Path=YAxisTitle}"/>
</telerik:ChartArea.AxisY>
<telerik:ChartArea.AxisX>
<telerik:AxisX Title="{Binding Path=XAxisTitle}"/>
</telerik:ChartArea.AxisX>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition />
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping DataPointMember="YValue" FieldName="YPlotPoint" PresentationTraceSources.TraceLevel="High"/>
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
I must apologize, actually AxisX and AxisY are dependency objects, so the only change would be to make Title property a dependency property. I have discussed this with our development team and they assured me this will be done for the next official release.
Best regards,
Ves
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
The release of RadControls for WPF Q3 2009 is planned for the first half of November. I hope this time frame will allow you to integrate the new version in your project.
Best wishes,
Ves
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.