Actually you can set the value - this documentation is misleading here. The property is declared READ-ONLY
in the interface (see the badge):
ISimpleLabelStyle.trimming API
But the instance that you have instanciated implements the interface and makes the property READ-WRITE
. Unfortunately the documentation is inherited from the interface and the only indication that the property is READ-WRITE is that the READ-ONLY
badge is missing in the API browser. Any property that is not READ-ONLY
or WRITE-ONLY
is implicitly readable and writable so setting the value will work using the property on the instance (SimpleLabelStyle.trimming API)
Note that if you are changing the value for an existing style, the change will not immediately be visible. You should invalidate the graph's displays using the
IGraph.invalidateDisplays() API
var style = new yfiles.drawing.SimpleLabelStyle()
style.trimming = yfiles.system.StringTrimming.ELLIPSIS_WORD;
graph.setLabelStyle(label, style);
// and later
style.trimming = yfiles.system.StringTrimming.ELLIPSIS_CHARACTER;
graph.invalidateDisplays();