MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / setEachItem

Function setEachItem

libs/echarts/echarts.simple.js:24241–24274  ·  view source on GitHub ↗
(val, dim)

Source from the content-addressed store, hash-verified

24239 : each$1(value, setEachItem);
24240
24241 function setEachItem(val, dim) {
24242 var dimInfo = data.getDimensionInfo(dim);
24243 // If `dimInfo.tooltip` is not set, show tooltip.
24244 if (!dimInfo || dimInfo.otherDims.tooltip === false) {
24245 return;
24246 }
24247 var dimType = dimInfo.type;
24248 var markName = 'sub' + series.seriesIndex + 'at' + markerId;
24249 var dimHead = getTooltipMarker({
24250 color: color,
24251 type: 'subItem',
24252 renderMode: renderMode,
24253 markerId: markName
24254 });
24255
24256 var dimHeadStr = typeof dimHead === 'string' ? dimHead : dimHead.content;
24257 var valStr = (vertially
24258 ? dimHeadStr + encodeHTML(dimInfo.displayName || '-') + ': '
24259 : ''
24260 )
24261 // FIXME should not format time for raw data?
24262 + encodeHTML(dimType === 'ordinal'
24263 ? val + ''
24264 : dimType === 'time'
24265 ? (multipleSeries ? '' : formatTime('yyyy/MM/dd hh:mm:ss', val))
24266 : addCommas(val)
24267 );
24268 valStr && result.push(valStr);
24269
24270 if (isRichText) {
24271 markers[markName] = color;
24272 ++markerId;
24273 }
24274 }
24275
24276 var newLine = vertially ? (isRichText ? '\n' : '<br/>') : '';
24277 var content = newLine + result.join(newLine || ', ');

Callers 1

formatArrayValueFunction · 0.70

Calls 5

pushMethod · 0.80
getTooltipMarkerFunction · 0.70
encodeHTMLFunction · 0.70
formatTimeFunction · 0.70
addCommasFunction · 0.70

Tested by

no test coverage detected