Is it possible to have "custom" labeling in the way that I control which label is displayed?
For example if I have a series of 20 datapoints, how can I set a label to just show the X-axis label on datapoint, say, 12 and 14 only? I tried setting the other datapoint labels to Nothing and empty string but it still displays a value.
Thanks in advance.
You can hide X-axis labels with:
<igChart:XamChart>
<igChart:XamChart.Axes>
<igChart:Axis AxisType="PrimaryX">
<igChart:Axis.Label>
<igChart:Label Visible="False" />
</igChart:Axis.Label>
</igChart:Axis>
</igChart:XamChart.Axes>
This turns labeling off for the entire X axis. How do I specify showing the label for a specific datapoint ?
For example, my series has 20 datapoints, and I want to show the X axis label for datapoint 5 only.
Thanks!
Hi Teodor,
Thank you for your post. I was struggling to achieve the same for last 2 days. Luckily came across your post and it solves my problem in a minute.
Thanks,
Ashutosh
You can try set to " " (interval).
I tried in the XAML:
<igChart:DataPoint Value="1" Label=" " />
In this case you don't need to specify label string formatting.
Thanks for the example. This example works fine when I set the datapoints in markup, and I was wondering how to make this happen if I am filling my chart from a dataset. The behavior is not as expected from your sample when I use:
<igChart:Series Name="Series_1" DataSource="{Binding Path=Table1}" DataMapping="Label=Timeframe; Value=Amount" />
I tried to set the datapoint labels in my code-behind afterwards to "" or Nothing to first try to get the labels out, but no avail. Thanks in advance.
You can try:
<igChart:Label Format="{}{0: }" />
<igChart:XamChart.Series>
<igChart:Series>
<igChart:Series.DataPoints>
<igChart:DataPoint Value="1" />
<igChart:DataPoint Value="2" />
<igChart:DataPoint Value="3" />
<igChart:DataPoint Value="4" />
<igChart:DataPoint Value="5" Label="The Label" />
<igChart:DataPoint Value="6" />
<igChart:DataPoint Value="7" />
<igChart:DataPoint Value="8" />
</igChart:Series.DataPoints>
</igChart:Series>
</igChart:XamChart.Series>
</igChart:XamChart>