I really like the "Luminol" theme, but when I use it, the theme overrides my Y axis formatting. I was originally setting the formatting in code using this:
Axis yAxis = new Axis();
yAxis.AxisType = AxisType.PrimaryY;
yAxis.Label.Format = "{0:n0}";
DataChart.Axes.Add(yAxis);
When I try using the "Luminol" theme, I lose the formatting on the Y axis and my numbers appear with no comma separators.
I've also tried setting the format in the XAML like this:
<igCA:XamChart x:Name="DataChart" Theme="Luminol">
<igCA:XamChart.Axes>
<igCA:Axis AxisType="PrimaryY">
<igCA:Axis.Label>
<igCA:Label Angle="-45" Format="{}{0:n0}" />
</igCA:Axis.Label>
</igCA:Axis>
</igCA:XamChart.Axes>
</igCA:XamChart>
By setting the format in the XAML, the numbers on my Y axis appear with the proper formatting, but I lose the color from the "Luminol" theme. In other words, the Y axis labels are black rather than the color set by "Luminol".
Is there a way to get both the formatting right and the theme color right?
Thanks, Steve
You can keep the color with:
<igChart:Label Angle="-45" Format="{}{0:n0}" Foreground="{StaticResource LabelYBrush}" />
When I first paste that into the xaml, the label in the designer does change to the proper color. However, as soon as I try to build the project, the designer unloads with an error. The exact error in the IDE is "StaticResource reference 'LabelYBrush' was not found".
Ok, in this case you can add this resource with:
<Grid.Resources>
<SolidColorBrush x:Key="LabelYBrush" Color="#FF9FABC0"/>
</Grid.Resources>
That worked, thanks.
Hi,
I dont know what it was, but did that many times and now it works. btw have the latest release.
Thank for the help though and sorry for being impatience:).
I’m trying this code and the x-labels are red:
<igCA:XamChart x:Name="xamChart" Theme="Aquarius" >
<igCA:Axis AxisType="PrimaryX">
<igCA:Label Foreground="Red" />
Can you try applying the latest service release?
Uhm, would appreciate if someone replied.
Hello, i am experiencing the same problem.
I have a xamChart with the theme RedPlanet but i want to change the appearance of the x-axe labels, such as color and size.
But when i follow the steps stated in this post, the color of the x-axe remains the color of the theme.
Can you help me?
Thank you