Profile Picture

Line Chart - only show every other x-axis label

Posted By Kandis Hoyt 13 Years Ago
Author
Message
Kandis Hoyt
Posted 13 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: 10 Years Ago
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!



Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746

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
Posted 13 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: 10 Years Ago
Posts: 3, Visits: 3
This worked. Thank you very much!



Similar Topics


Reading This Topic