代码拉取完成,页面将自动刷新
uniapp项目中opts.xAxis.boundaryGap为center时, APP 微信小程序 H5 都不能选择最后一个toolTip,但是当值为justify就正常。自己的程序和例子程序均复现(【例子:曲线图】pages/basic/line/curve)
确认是个bug
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
已修复,不知道会不会影响其他地方。
function findCurrentIndex(currentPoints, calPoints, opts, config) {
var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
var currentIndex = -1;
var spacing = opts.chartData.eachSpacing/2;
let xAxisPoints=[];
// debugger
if(calPoints.length>0){
for(let i=1;i<opts.chartData.xAxisPoints.length;i++){
xAxisPoints.push(opts.chartData.xAxisPoints[i]-spacing)
}
xAxisPoints.push(opts.chartData.xAxisPoints[opts.chartData.xAxisPoints.length - 1] + spacing)
if((opts.type=='line' || opts.type=='area') && opts.xAxis.boundaryGap=='justify'){
spacing = opts.chartData.eachSpacing;
// spacing = opts.chartData.eachSpacing/2;
}
if(!opts.categories){
spacing=0
}
if (isInExactChartArea(currentPoints, opts, config)) {
xAxisPoints.forEach(function(item, index) {
if (currentPoints.x + offset + spacing > item) {
currentIndex = index;
}
});
}
}
return currentIndex;
}
已修复,不知道会不会影响其他地方。
function findCurrentIndex(currentPoints, calPoints, opts, config) { var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; var currentIndex = -1; var spacing = opts.chartData.eachSpacing/2; let xAxisPoints=[]; // debugger if(calPoints.length>0){ for(let i=1;i<opts.chartData.xAxisPoints.length;i++){ xAxisPoints.push(opts.chartData.xAxisPoints[i]-spacing) } xAxisPoints.push(opts.chartData.xAxisPoints[opts.chartData.xAxisPoints.length - 1] + spacing) if((opts.type=='line' || opts.type=='area') && opts.xAxis.boundaryGap=='justify'){ spacing = opts.chartData.eachSpacing; // spacing = opts.chartData.eachSpacing/2; } if(!opts.categories){ spacing=0 } if (isInExactChartArea(currentPoints, opts, config)) { xAxisPoints.forEach(function(item, index) { if (currentPoints.x + offset + spacing > item) { currentIndex = index; } }); } } return currentIndex; }
@teanfoo 感谢付出
登录 后才可以发表评论