Profile Picture

Month end date for X-Axis label

Posted By Tanawit Boonteppratan 11 Years Ago
Author
Message
Tanawit Boonteppratan
Posted 11 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 11 Years Ago
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 (401 views, 79.00 KB)
Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054, Visits: 4,009

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
Posted 11 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 11 Years Ago
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 (388 views, 25.00 KB)
Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054, Visits: 4,009
Hi Swathi,

Can you elaborate on this question?

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic