How to make end labels always visible?
Moderator: Queue Moderators
How to make end labels always visible?
How to make end labels always visible in ViewXY XAxes and YAxes?
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: How to make end labels always visible?
LightningChart has 0 as reference point. In many instances, if Axis range is not starting from zero the 1st label will not at minimum. In addition, automated ticks calculator not support unequal interval between ticks. However, there is easy solution - use custom ticks. For example, for XAxis:
Hope this helps.
Code: Select all
//Set custom ticks for X axis,
int[] aTickValues = new int[] { 25, 500, 1000, 1500, 2000, 2500, 3025 };
for (int i=0; i<aTickValues.Length; i++)
{
CustomAxisTick cTick = new CustomAxisTick(axisX, aTickValues[i], aTickValues[i].ToString(), 6, true, axisX.MajorDivTickStyle.Color, CustomTickStyle.TickAndGrid);
axisX.CustomTicks.Add(cTick);
}
//Allow showing the custom tick strings
axisX.CustomTicksEnabled = true;
axisX.InvalidateCustomTicks();