Page 1 of 1

How to make end labels always visible?

Posted: Wed Jun 27, 2018 6:49 am
by UserX
How to make end labels always visible in ViewXY XAxes and YAxes?

Re: How to make end labels always visible?

Posted: Thu Jun 28, 2018 10:21 am
by ArctionKestutis
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:

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();
Hope this helps.