animationDurationUpdate: function (idx) { // 越往后的数据延迟越大 return idx * 100 },
时间: 2024-02-15 14:42:01 浏览: 26
This function is used to set the animation duration for each data point in a chart. The animation duration increases as the index of the data point increases. The formula used to calculate the animation duration is simply the index multiplied by 100. Therefore, the later data points have a longer animation duration compared to the earlier ones. This creates a visual effect where the chart is animated in a staggered manner, making it more visually appealing to the user.
相关问题
visualMap: { type: 'piecewise', //属性类型为分段型 categories: ['2020年', '2021年'],// 数据类别,即图例 dimension: CATEGORY_DIM, // 数据的维度,这里为类别维度 orient: 'horizontal', // 图例排列方式为水平排列 top: 0, // 图例距离容器顶部的距离为0 left: 'center', // 图例左右居中 inRange: { color: ['#51689b', '#ce5c5c'] // 数据的范围映射到颜色的渐变区间 }, outOfRange: { color: '#ddd' // 颜色渐变区间,根据实际需要设置颜色 }, seriesIndex: gridOption.series.map(function (_, idx) { return idx; }) }, tooltip: { trigger: 'item' },
2020年', '2021年'],
dimension: CATEGORY_DIM,
orient: 'horizontal',
top: 0,
left: 'center',
inRange: {
color: ['blue', 'green'],
}
}
}
这段代码是用来规定图表中颜色和图例的显示方式。具体来说,它指定了图例的类型为分段型,数据类别为2020年和2021年,数据的维度为类别维度,图例为水平排列,距离容器顶部的距离为0,而左右居中。在图表中颜色的范围内,使用蓝色和绿色,代表不同的数据范围。
解释下面代码static UINT8 libTXT2PDU( UINT8* msgData, UINT16 msgLen, UINT8* pTpdu, AtciMsgInfo *pAtSmsMessage, AtciCharacterSet chset_type ) { UINT8 offset = 0; UINT16 len=0; //CPUartLogPrintf("%s: enter", __FUNCTION__); //int i; //for(i=0;i<msgLen;i++) //CPUartLogPrintf("%s: msgData[%d] %d 0x%x", __FUNCTION__, i, msgData[i], msgData[i]); /* Copy the first octet */ /*SIMCom xiaokai.yang sync sms code @2023-02-06 begin*/ #ifdef FEATURE_SIMCOM_SMS char headbuf[PDU_HEAD_SIZE] = {0x05,0x00,0x03}; scCmssexInfoT* p_CmgsexInfo = (scCmssexInfoT*)getCmgsexInfoInd(); if(pAtSmsMessage->udhPresent) { pTpdu[ offset++ ] = (pAtSmsMessage->fo)|(0x1<<6); } else #endif /*SIMCom xiaokai.yang sync sms code @2023-02-06 end*/ pTpdu[ offset++ ] = pAtSmsMessage->fo; /* Message Reference */ pTpdu[ offset++ ] = pAtSmsMessage->msgRef; /* Originating Address (TP-OA) */ { UINT8 idx; UINT8 *data; data = pTpdu + offset; /* Set the Address Length octet */ *data++ = strlen( (char *)pAtSmsMessage->destAddr ); #ifdef FEATURE_SIMCOM_SMS PAL_LogIo(SC_MODULE_SMS,PAL_DBG_LEVEL_INFO,"destAddr [%s]",( (char *)pAtSmsMessage->destAddr )); #endif /* Format the TON/NPI octet */ *data++ = (UINT8)((pAtSmsMessage->addrType << 4) | pAtSmsMessage->addrPlan | 0x80); /* Format the BCD digits */ for ( idx = 0; idx < strlen( (char *)pAtSmsMessage->destAddr ); idx++ ) { libPutPackedBcd( data, idx, pAtSmsMessage->destAddr[ idx ], TRUE ); } /* check if we need to tack on a filler */ if( idx & 0x01 ) { /* Yup -- do it! , reversed nibbles */ libPutPackedBcd( data, idx, ATCI_BCD_FILLER, TRUE ); ++idx; } /* We're done -- update the PDU byte index */ offset += idx/2 + ATCI_SMS_BCD_POS; } /* Protocol Identifier (TP-PID) */ pTpdu[ offset++ ] = pAtSmsMessage->pid; /* Data Coding Scheme (TP-DCS) */ pTpdu[ offset++ ] = pAtSmsMessage->dcs; if(((pAtSmsMessage->fo&ATCI_TP_MTI_MASK)==ATCI_SMS_SUBMIT_MTI)&&((pAtSmsMessage->fo&ATCI_SMS_TP_VPF)==0x10)) { pTpdu[ offset++ ] = pAtSmsMessage->vp; } /*SIMCom xiaokai.yang sync sms code @2023-02-06 begin*/ #ifdef FEATURE_SIMCOM_SMS if(pAtSmsMessage->udhPresent) { headbuf[3] = p_CmgsexInfo->mr; headbuf[4] = p_CmgsexInfo->msg_total; headbuf[5] = p_CmgsexInfo->msg_seg; memmove(msgData+PDU_HEAD_SIZE,msgData,msgLen); memcpy(msgData, headbuf, PDU_HEAD_SIZE); msgLen+=PDU_HEAD_SIZE; } PAL_LogIo(SC_MODULE_SMS,PAL_DBG_LEVEL_INFO,"offset1 [%d],msgLen=%d",offset,msgLen);//274 #endif /*SIMCom xiaokai.yang sync sms code @2023-02-06 end*/ /* Now for the Message Data (TP-UDL + TP-UD) */ //ScShowDataByHex((char *)pTpdu, offset); //CPUartLogPrintf("[sms]msgLen=%d",msgLen); libMsgEncodeUserData( pAtSmsMessage->udhPresent, pAtSmsMessage->dcs, pTpdu, msgData, msgLen, offset, &len,chset_type); return len; }
这段代码是一个函数,名为libTXT2PDU,其作用是将短信数据从文本格式转化为PDU格式。它的参数包括短信数据的指针msgData、短信数据长度msgLen、PDU数据的指针pTpdu、AtciMsgInfo结构体指针pAtSmsMessage和字符集类型chset_type。函数内部定义了一个偏移量变量offset和一个长度变量len,并且初始化为0。接下来通过判断宏定义FEATURE_SIMCOM_SMS是否被定义,如果被定义则会执行一些与SIM卡相关的代码。然后根据短信数据的格式对PDU数据进行逐个赋值,包括格式、消息参考、源地址、协议标识、数据编码方式等。最后通过调用libMsgEncodeUserData函数对短信数据进行编码,并返回编码后的长度。