Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1310
How can I show Strings in a numeric Axis populated by a tickmark?
posted

Hello!

I have been working hard to show strings values in XAxis with a scatterLineSerie. Individually it works, but the dates shown were not the desired ones, so I decided to use the TickMarkValues with the dates I want.

I use a converter to return strings from dates. How? Sending the ticks of each date and converting back to string:

XAML:

  <ig:NumericXAxis.Label>
     <DataTemplate>
          <TextBlock Text="{Binding Item,
 Converter
={StaticResource TicksToDateTimeConverter}, StringFormat=d}"                         Foreground="White" />            </DataTemplate>    </ig:NumericXAxis.Label>

My converter:

 object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //return new DateTime(Convert.ToInt64(value)).ToShortDateString();
            return new DateTime(Convert.ToInt64(value)).ToString("MM/yyyy");
            //return new DateTime(Convert.ToInt64(value)).ToString("MM/dd/yyyy");
           
        }
My problem now is that with the tickmarks I receive in my converter the TickMarkValues
and I don't know how to return them in stringFormat:

XAML:
  <ig:NumericXAxis x:Name="xAxis"                TickmarkValues="{Binding MyView,                     Path=TickmarkValues,Mode=TwoWay}">

Any idea of how can I do this? Thank you
Parents
  • 27093
    posted

    Hello,

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

    If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

Reply Children