11-09-2021 07:03 AM
Hello,
I have a graph from NI Measurement Studio 2013 WPF
I've insered a cursor into it.
I would like to show the cursor value but only the x value.
How to do this ?
Solved! Go to Solution.
11-09-2021 03:01 PM
If you want a single interactive line, consider using a MultiPlotCursor
instead of a Cursor
. This can be configured to only show the value of the horizontal axis by excluding association with any plots (using an empty include list):
<ni:MultiPlotCursor AllowablePlots="Include:" />
Otherwise, you would need to create a custom class to use as the ValuePresenter
for the cursor, and have it only display the first dimension of incoming data. Something like this:
protected override string FormatCore<TData>( TData value, ValuePresenterArgs args ) {
string result =
value is IList dimensions
? DimensionFormatter.Format( dimensions[0], args )
: DimensionFormatter.Format( value, args );
return result;
}
11-10-2021 06:05 AM
Hello Phansen,
Thank you for the answer.
For the second solution, I don't understand your solution. 🤔.
the Cursor.ValuePresenter property type is ValuePresenter and I don't understand how to use your proposition.
Thx.
F.
11-10-2021 10:27 AM
Sorry for the isolated example code! Attached is a complete implementation of a custom value presenter class.
11-17-2021 09:24 AM
Hello,
sorry for the delay, some other stuffs to take care 😋.
I've finally managed to integrate your code into my application
Some adaptation to downgrade into c# 4.8 but all is ok !
Thx very much.
F.