echarts中series的动态渲染

该博客探讨了如何使用ECharts库在JavaScript前端环境中动态渲染X轴为当月天数的日期数据。文章强调了当接口返回的数据包含当日记录时如何展示这些数据点。
摘要由CSDN通过智能技术生成

后端返回接口数据如下:
请添加图片描述
要求:X轴为当月天数取日期,要求实现当返回数据中有当日时,显示数据

domesticOptions() {
         return {
            tooltip: {
               trigger: 'axis',
               formatter: function(obj) {
                  let str = '';
                  str = '<div style="font-size: 12px;"><p style="color:#fff;lineHeight:18px;height:18px;margin-bottom:10px;">' + obj[0].name + '</p>';
                  obj.map(item => {
                     const value = isNull(item.value, 2);
                     const subStr = '<div style=\'lineHeight:22px;height:24px;\'><div style=\'display:inline-block;width:5px;height:5px;margin-right:6px;background:' +
                       item.color + ';border-radius:50%;m
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值