Issue: Styles and formatting data not applied for axis labels and titles. (working fine in visible state)
Applying Styles and formatting data not applied for axis labels and titles in code behind because of runtime creation of different charts and grid view.
This is working only when the control is Visible and visible property is true
please assist, even i used .UpdateLayout() and UpdateTemplate methods.
Thanks
Narayan
Can you explain how what you are trying is different from the below sample. In the sample I can click hide then change then show, and the format for the labels has been updated.The Xaml:
<Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <igChart:XamChart x:Name="theChart"> <igChart:XamChart.Axes> <igChart:Axis AxisType="PrimaryY"> <igChart:Axis.Label> <igChart:Label Format="Test: {0}" /> </igChart:Axis.Label> </igChart:Axis> </igChart:XamChart.Axes> <igChart:XamChart.Series> <igChart:Series ChartType="Column"> <igChart:Series.DataPoints> <igChart:DataPoint Label="A" Value="1" /> <igChart:DataPoint Label="B" Value="2" /> <igChart:DataPoint Label="C" Value="3" /> <igChart:DataPoint Label="D" Value="4" /> </igChart:Series.DataPoints> </igChart:Series> </igChart:XamChart.Series> </igChart:XamChart> <StackPanel Grid.Row="1" Orientation="Horizontal"> <Button x:Name="hide" Content="Hide" Click="hide_Click" /> <Button x:Name="change" Content="Change" Click="change_Click" /> <Button x:Name="show" Content="Show" Click="show_Click" /> </StackPanel> </Grid>
And the code behind:
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void change_Click(object sender, RoutedEventArgs e) { theChart.Axes[0].Label.Format = "Test2: {0}"; } private void hide_Click(object sender, RoutedEventArgs e) { theChart.Visibility = Visibility.Collapsed; } private void show_Click(object sender, RoutedEventArgs e) { theChart.Visibility = Visibility.Visible; } }
Thanks,-Graham
Nothing happens by calling refresh method.
~Narayan
Hi,
What happens if you call Refresh on the chart after making it visible again?
-Graham
Like i mentioned in previous thread, so many features is not working like mouse double click event, filters, Axis title ,Axis labels are not working if you are applying when the control property is in Visible=collapse and Works fine when control Visibility property Visible using some button click event.
Not work In Invisible state
===========================
xamchrt.Visibility = Visibility.collapse;
xamchrt.Style = (Style)FindResource("ChartLabelTemplate");
xamchrt.Axes[0].Label.Format = ("{0:@}").Replace("@", CustomLocaleSettings.CurrencyFormat);
And work fin in Visible state
===================
Just we are toggling the xamchart view and grid view based on two buttons (btnChartView and btnGridView)
Thanks in advance.