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

Function getDefaultLabel

src/chart/helper/labelHelper.ts:29–48  ·  view source on GitHub ↗
(
    data: SeriesData,
    dataIndex: number
)

Source from the content-addressed store, hash-verified

27 * @return label string. Not null/undefined
28 */
29export function getDefaultLabel(
30 data: SeriesData,
31 dataIndex: number
32): string {
33 const labelDims = data.mapDimensionsAll('defaultedLabel');
34 const len = labelDims.length;
35
36 // Simple optimization (in lots of cases, label dims length is 1)
37 if (len === 1) {
38 const rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);
39 return rawVal != null ? rawVal + '' : null;
40 }
41 else if (len) {
42 const vals = [];
43 for (let i = 0; i < labelDims.length; i++) {
44 vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));
45 }
46 return vals.join(' ');
47 }
48}
49
50export function getDefaultInterpolatedLabel(
51 data: SeriesData,

Callers 6

styleFunction · 0.90
styleEmphasisFunction · 0.90
getLabelDefaultTextMethod · 0.90
updateStyleFunction · 0.90
updateCommonFunction · 0.90
defaultTextMethod · 0.90

Calls 2

retrieveRawValueFunction · 0.90
mapDimensionsAllMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…