Line Chart - only show every other x-axis label


Author
Message
Kandis Hoyt
Kandis Hoyt
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: 3, Visits: 3
This worked. Thank you very much!
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 Kandis,
You can achieve this with some custom code - 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];

NOrdinalScaleConfigurator scaleX = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;
if (scaleX != null)
{
scaleX.MajorTickMode = MajorTickMode.CustomStep;
scaleX.CustomStep = 1;
scaleX.NumberOfTicksPerLabel = 2;
scaleX.LabelStyle.ContentAlignment = ContentAlignment.MiddleCenter;
scaleX.DisplayDataPointsBetweenTicks = false;
}
}
}
}

shows a label at every two ticks. Hope this helps - let us know if you meet any problems.

 



Best Regards,
Nevron Support Team


Kandis Hoyt
Kandis Hoyt
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: 3, Visits: 3

Hello - I need some help please.

I created a basic line chart that has data by week of year (01-52). I chose the option for categorical for the scale mode (although auto works as well). The text become very small when I deleted the checkbox to stagger the labels and only use the Autoscale option. I want to show only every other data label (ex. 01, 03, 05 etc.). Is there a way to do this?

Thanks!


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