const targetArray=[ { "date": "2023-02-04", "avenues": { "自访": 1, "转介": 0, "自拓": 0, "电call": 0, "老客户": 0 }, "dataCount": 1,"张巧儿": { "自访": 1, "转介": 0, "自拓": 0, "电call": 0,"老客户": 0 } },function getOption() { const avenues = targetArray[0].avenues return { xAxis: { type: 'category', data: avenues }, yAxis: { type: 'value' }, series: [{ name: 'avenues', type: 'bar', data: [ avenues.map(item => targetArray[0].avenues[item]) ] }] }; };打印data会输出什么内容
时间: 2023-07-19 07:36:49 浏览: 64
打印data会输出以下内容:
```
[
{
"date": "2023-02-04",
"avenues": {
"自访": 1,
"转介": 0,
"自拓": 0,
"电call": 0,
"老客户": 0
},
"dataCount": 1,
"张巧儿": {
"自访": 1,
"转介": 0,
"自拓": 0,
"电call": 0,
"老客户": 0
}
},
function getOption() {
const avenues = targetArray[0].avenues;
return {
xAxis: {
type: 'category',
data: avenues
},
yAxis: {
type: 'value'
},
series: [{
name: 'avenues',
type: 'bar',
data: [
avenues.map(item => targetArray[0].avenues[item])
]
}]
};
}
]
```
其中包含一个对象和一个函数。对象中包含了一个日期、一个渠道对象、一个数据计数和一个人员对象。函数用于返回一个 Echarts 图表的配置项。
阅读全文