How can I show Strings in a numeric Axis populated by a tickmark?

Not Answered This post has 0 verified answers | 10 Replies | 2 Followers Thread's RSS feed.

mekoloko
Points 1,295
Replied On: Wed, Feb 29 2012 6:42 AM Reply

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
  • Post Points: 35

All Replies

Replied On: Thu, Mar 22 2012 5:33 AM Reply

Hello,

 

I have been looking into your issue and I can suggest you take a look through this forum thread that appears to discuss the same issue: http://forums.infragistics.com/forums/p/67174/339922.aspx# . In it there is also a sample project that converts the DateTime.Ticks to Labels inside an IValueConverter.

 

Please let me know if I can be of any further assistance on the matter.

Sincerely,
Petar, MCTS
Software Developer 
Infragistics
www.infragistics.com\support

  • Post Points: 5
Replied On: Tue, Mar 27 2012 3:02 AM Reply

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.

Sincerely,
Petar, MCTS
Software Developer 
Infragistics
www.infragistics.com\support

  • Post Points: 20
mekoloko
Points 1,295
Replied On: Tue, Mar 27 2012 4:31 AM Reply

Hello! I have had no time to verify this solution, sorry. I will check it ASAP. Thank you!!! :)

  • Post Points: 20
Replied On: Fri, Mar 30 2012 3:38 AM Reply

Hi,

Thank for the update I am looking forward to hearing from you.

Sincerely,
Petar, MCTS
Software Developer 
Infragistics
www.infragistics.com\support

  • Post Points: 20
mekoloko
Points 1,295
Replied On: Wed, Apr 4 2012 4:15 AM Reply

Morning!!

The conversion problem is solved, but my problem is that it shows my data values dates converted, what I am looking for is to show some concrete tickmarck values. Going back with the example of your link, I would like to display for 2000 points data the first day of each month.

EX: 2000 points of data that I know that goes from year 2012 to 2014. I would like to display 1/january/2012, 1/february/2012 and so on until 1/January/2015. Even more, it is possible that there is no point for the first day of some months.

The problem I have found that for scatter series, my custom tickmarck values are not displayed and instead, it shows values of the data displayed in the graph, without any possibility to customize the values to be displayed in the Xaxis.

  • Post Points: 5
mekoloko
Points 1,295
Replied On: Wed, Apr 4 2012 9:08 AM Reply

If it can be useful, I have seen that my converter receives only a few points. Does the ScatterLineSeries choose random points to display in X axis.

Ex: I have 2000 points and the ScatterLineSeries by default divides in 10 the XAxis, so it sends only the points of the list that are in positions 0,200,400,600... 2000.

Definitively, I don't understand how can I stablish my custom XAxis labels...

  • Post Points: 35
Replied On: Wed, Apr 4 2012 12:05 PM Reply

Hello,

 

I understand what you mean, however the NumericAxes are designed to create these values base on the minimum and maximum values they are to visualize and also according to the Interval property. This means that the labels that are shown are positioned in equal intervals, as where the 1st day of each month are not. If you want you can switch to using CategoryDateTimeAxis, which places a label for each DataPoint as described here: http://help.infragistics.com/NetAdvantage/DV/2011.2/CLR4.0/?page=xamDataChart_Axes.html

 

Please let me know if I can be of any further assistance on the matter.

Sincerely,
Petar, MCTS
Software Developer 
Infragistics
www.infragistics.com\support

  • Post Points: 5
Replied On: Wed, Apr 11 2012 4:50 AM Reply

Hello mekoloko,

I am still following your thead. I am just checking the progress of this ticket and if you need any more assistance.

Sincerely,
Petar, MCTS
Software Developer 
Infragistics
www.infragistics.com\support

  • Post Points: 20
mekoloko
Points 1,295
Replied On: Wed, Apr 11 2012 5:44 AM Reply

Hello!

I have had no time to check your solution, when I test it I will give you a feedback. Sorry

  • Post Points: 20
Replied On: Wed, Apr 18 2012 2:22 AM Reply

Hi mekoloko,

 

Thank you for the update, I’ll be waiting for your follow-up on this.

Sincerely,
Petar, MCTS
Software Developer 
Infragistics
www.infragistics.com\support

  • Post Points: 5
Page 1 of 1 (11 items) | RSS