395 Star 3.4K Fork 668

GVPuCharts / uCharts

 / 详情

关于在微信小程序下Y轴一直将值自动补0

已完成
任务
创建于  
2020-05-24 22:37

该问题是怎么引起的?

在uni-app内使用,编译在微信小程序下
微信小程序基础库2.9.2

重现步骤

// 配置如下
const paras = {
$this: this,
canvasId: canvasId,
type: "line",
fontSize: 11,
legend: { show: true },
dataLabel: false,
dataPointShape: true,
background: "#FFFFFF",
pixelRatio: 1,
categories: [
"2020-05-25 06:33:00",
"2020-05-25 06:33:03",
"2020-05-25 06:33:06",
"2020-05-25 06:33:09",
"2020-05-25 06:33:12",
"2020-05-25 06:33:15",
"2020-05-25 06:33:18",
"2020-05-25 06:33:21",
"2020-05-25 06:33:24",
"2020-05-25 06:33:30",
"2020-05-25 06:33:33",
"2020-05-25 06:33:36",
"2020-05-25 06:33:39",
],
series: [
{
area: [161, 219, 224, 230],
color: "#000000",
data: [
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
"0.62",
],
index: 0,
legendShape: "line",
name: "参数一",
pointShape: "circle",
show: true,
type: "line",
},
],
animation: true,
xAxis: {
type: "grid",
gridColor: "#CCCCCC",
gridType: "dash",
rotateLabel: true,
fontSize: "0",
},
yAxis: {
gridType: "dash",
gridColor: "#CCCCCC",
},
width: 375,
height: 250,
extra: {
line: {
type: "straight",
},
},
};

new uCharts(paras);

报错信息

输入图片说明

最后这个Y周不知道为何会一直补0呢?我在文档里面并没有找到对应的设置,手动将值设置为string或者number类型都是会补全

评论 (1)

达摩利克斯之剑 创建了任务
展开全部操作日志

使用y轴的format 格式化数据

yAxis: {
    data: [
        {
          format: function (value) {
               return value.toFixed(1);
          },      
        }    
    ]
}
16cheng 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
JavaScript
1
https://gitee.com/uCharts/uCharts.git
git@gitee.com:uCharts/uCharts.git
uCharts
uCharts
uCharts

搜索帮助