How to make end labels always visible?

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Arction_LasseP

Posts: 3
Joined: Wed Jun 27, 2018 6:45 am

How to make end labels always visible?

Post by UserX » Wed Jun 27, 2018 6:49 am

How to make end labels always visible in ViewXY XAxes and YAxes?

Posts: 392
Joined: Mon Mar 14, 2016 9:22 am

Re: How to make end labels always visible?

Post by ArctionKestutis » Thu Jun 28, 2018 10:21 am

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);
            //Allow showing the custom tick strings
            axisX.CustomTicksEnabled = true;
Hope this helps.