MCPcopy
hub / github.com/apache/echarts / setLabelText

Function setLabelText

src/label/labelStyle.ts:130–143  ·  view source on GitHub ↗
(label: ZRText, labelTexts: Record<DisplayState, string>)

Source from the content-addressed store, hash-verified

128> = Model<LabelCommonOption<TNuance>>;
129
130export function setLabelText(label: ZRText, labelTexts: Record<DisplayState, string>) {
131 for (let i = 0; i < SPECIAL_STATES.length; i++) {
132 const stateName = SPECIAL_STATES[i];
133 const text = labelTexts[stateName];
134 const state = label.ensureState(stateName);
135 state.style = state.style || {};
136 state.style.text = text;
137 }
138
139 const oldStates = label.currentStates.slice();
140 label.clearStates(true);
141 label.setStyle({ text: labelTexts.normal });
142 label.useStates(oldStates, true);
143}
144
145function getLabelText<TLabelDataIndex>(
146 opt: SetLabelStyleOpt<TLabelDataIndex>,

Callers 2

setLabelStyleFunction · 0.85
duringFunction · 0.85

Calls 2

clearStatesMethod · 0.80
setStyleMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…