I would like to change the Y-axis label to a custom string label. I have a waveform that consists of binary data - 0 or 1. When it's 0 it's OFF and when it's 1 it's ON. I would like to change the Y-axis to OFF and ON for 0 and 1, respectively.
You should be able to do this with value pairs. Try the following steps:
Right-click on the graph in the form editor and click on "Properties ..." to bring up the property pages.
Click on the "Value Pairs" tab.
In the Axis drop-down, select the y axis you would like to apply custom labels to ("YAxis-1" by default).
Click "Add" twice and set the first value pair's name to Off with the value set to 0 and the second value pair's name to On with the value set to 1.
You may want to also go to the Ticks tab to make further adjustments. For example, if these value pairs are the only ticks and labels you want to appear, you may want to change the tick spacing to "By Units" and set major, minor, and base to 0.
Have you tried this in C# or VB.NET? I am trying to do this in C# and have been successful in creating a simple form with a CWGraph object. However, I don't see the CWAxis exposed. I only see the following objects exposed: * CWButton, CWGraph, CWKnob, CWNumEdit, CWSlide
Take a look at your project references after you add the graph to the form in a C# or VB.NET project. You'll notice that there are two interop assemblies in the references - AxCWUIControlsLib and CWUIControlsLib. CWUIControlsLib is the interop assembly that contains .NET versions of all of the interfaces from the type library in cwui.ocx, and AxCWUIControlsLib has some wrapper classes for the actual control objects and it uses the interfaces from CWUIControlsLib. Take a look at the interfaces that are contained in CWUIControlsLib and you'll see it has CWAxis as well as the rest of the sub objects.
To get the example working in C#, add this to the top of the source file:
using CWUIControlsLib;
The C# translation of the VB example above would look like this: