Month end date for X-Axis label


Author
Message
Tanawit Boonteppratan
Tanawit Boonteppratan
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 1, Visits: 1
Hello,

I have an Area chart SubType "XY Scatter (3)"
The Primary X Axis Scale-> SubType is DateTime.
The data is daily, the Axis label is displaying beginning of the month.
Is there a way to make the X-Axis labels display month end date instead?
IE instead of 1/1/2013 can the X-Axis display 1/31/2013 ?

Thank you
Attachments
MonthEndDateLabels.png (422 views, 79.00 KB)
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Tanawit,

You can use custom code to apply an offset to the actual formatted value of the labels - for example:

using System;
using System.Drawing;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;

namespace MyNamespace
{
 /// <summary>
 /// Sample class
 /// </summary>
 public class MyClass
 {
  /// <summary>
  /// Main entry point
  /// </summary>
  /// <param name="context"></param>
  public static void RSMain(NRSChartCodeContext context)
  {
   NChart chart = context.Document.Charts[0];
   
   NDateTimeScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NDateTimeScaleConfigurator;
   
   if (scale != null)
   {
    DateTime dt1 = new DateTime();
    DateTime dt2 = dt1.AddMinutes(1);

    scale.LabelStyle.ValueOffset -= dt2.ToOADate() - dt1.ToOADate();
   }
  }
 }
}


Configures the chart to display the previous day so if you have a label 1/2/2013 it will be actaully formatted as 31/1/2013. Hope this helps - let us know if you meet any problems...



Best Regards,
Nevron Support Team


Swathi Sadasivam
Swathi Sadasivam
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 2, Visits: 1
Regarding the same issue
How to set the interval range so that the dates corresponding to the range interval is plotted instead of the first days of months?

Similar to the date range in the screenshot added.
Attachments
DateRange.png (406 views, 25.00 KB)
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Swathi,

Can you elaborate on this question?

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search