How would go about setting the x and y axis titles. These are captions below the ticks (ie. Years)?
Thanks,
Steve
This should obviously be a native feature of the XamChart
Why aren't such labels provided in the xamchart? A caption is provided, why not these labels?
thanks, now it really looks nice.
When you set the chart's template the theme change is not allowed to override the chart's template, so some details of the neon theme at the level of the chart are lost. You can adjust for this by reconciling the template you are specifying with the neon theme's template. Here's the modified version:
<Window.Resources> <SolidColorBrush x:Key="CaptionForegroundBrush" Color="#FFFFFFFF"/> <Style x:Key="captionStyle" TargetType="TextBlock"> <Setter Property="Foreground" Value="{StaticResource CaptionForegroundBrush}"/> <Setter Property="FontFamily" Value="/xamFeatureBrowserResources;Component/fonts/#Avenir"/> <Setter Property="FontSize" Value="16"/> <Setter Property="FontWeight" Value="Bold" /> </Style> <ControlTemplate x:Key="chartTemplate" TargetType="igChart:XamChart"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,0,0,0"> <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <ContentPresenter Name="PART_Default_Chart" Grid.Row="0" Grid.Column="1" /> <TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" TextAlignment="Center" Style="{StaticResource captionStyle}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:AxisInfo.YAxisTitle)}"> <TextBlock.LayoutTransform> <RotateTransform Angle="90" /> </TextBlock.LayoutTransform> </TextBlock> <TextBlock Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource captionStyle}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:AxisInfo.XAxisTitle)}" TextAlignment="Center" /> </Grid> </Border> </ControlTemplate> </Window.Resources>
Hope this helps!
-Graham
Hi,
thank you very much for the example. I got it working. Unfortunately I still have the problem with the theme of the XamGraph. As you can see in the attached image, it's not really the Neon theme. In the second image it's a bit like the neon theme, but the backgroundcolor is not correct.
Because of the white background, I cannot see the caption. Of cause I can set the color of it manually, but I would like to have the background just like the neon theme.
As I am no expert in Templates, maybe you can give me an hint how to place the axis information more near to the axis. I would like to have the x-axis info on the bottom right and the y-axis on the top left of the graph.
Thanks a lot!
Gawain