Profile Picture

Line Chart - only show every other x-axis label

Posted By Kandis Hoyt 14 Years Ago

Line Chart - only show every other x-axis label

Author
Message
Kandis Hoyt
Posted 14 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: 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 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)Supreme Being (4,437 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 3,055, Visits: 4,055

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 14 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: 3, Visits: 3
This worked. Thank you very much!



Similar Topics


Reading This Topic

1 active, 1 guest, 0 members, 0 anonymous.
No members currently viewing this topic!