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

Function makeCategoryData

test/tooltipTestHelper.js:36–74  ·  view source on GitHub ↗
(scale, catePrefix, dataCount)

Source from the content-addressed store, hash-verified

34}
35
36function makeCategoryData(scale, catePrefix, dataCount) {
37 var categoryData = [];
38 var data1 = [];
39 var data2 = [];
40 var data3 = [];
41 scale = scale || 1;
42 catePrefix = catePrefix || 'category';
43 dataCount = dataCount || 10;
44
45 categoryData.push(catePrefix + -1);
46 data1.push('-');
47 data2.push('-');
48 data3.push('-');
49
50 for (var i = 0; i < 5; i++) {
51 categoryData.push(catePrefix + i);
52 data1.push(((-Math.random() - 0.2) * scale).toFixed(3));
53 data2.push(((Math.random() + 0.3) * scale).toFixed(3));
54 data3.push(((Math.random() + 0.2) * scale).toFixed(3));
55 }
56
57 categoryData.push(catePrefix + i);
58 data1.push('-');
59 data2.push('-');
60 data3.push('-');
61
62 for (; i < dataCount - 1; i++) {
63 categoryData.push(catePrefix + i);
64 data1.push(((-Math.random() - 0.2) * scale).toFixed(3));
65 data2.push(((Math.random() + 0.3) * scale).toFixed(3));
66 data3.push(((Math.random() + 0.2) * scale).toFixed(3));
67 }
68 categoryData.push(catePrefix + i);
69 data1.push('-');
70 data2.push('-');
71 data3.push('-');
72
73 return {categoryData: categoryData, data1: data1, data2: data2, data3: data3};
74}
75
76function makeValueData() {
77 var data1 = [];

Callers 3

makeCategoryPolarFunction · 0.85
makeCategoryGridFunction · 0.85
makeCategoryCartesianFunction · 0.85

Calls 1

toFixedMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…