根据官方添加了属性,滚动条出来了,但是不能滑动
- 发布:2021-12-28 21:17
- 更新:2021-12-29 11:45
- 阅读:831
#插件讨论# 【 秋云 ucharts echarts 高性能跨全端图表组件 - 秋云 】滚动条不能滑动
1***@qq.com (作者)
附上代码
<canvas canvas-id="canvasBar" id="canvasBar" class="bar-charts" style="height: 420rpx;" />
getBarServerData(barList) {
let Radar = {
categories: [],
series: []
};
var realityDatas = new Array(); //实际数据
//实际数据赋值
/* for(var i = 0;i<barList.length;i++){
Radar.categories.push(barList[i].Time);
}
for(var i = 0;i<barList.length;i++){
realityDatas.push(barList[i].HuanCount);
} */
realityDatas.push("11");
realityDatas.push("22");
realityDatas.push("33");
realityDatas.push("41");
realityDatas.push("51");
realityDatas.push("11");
realityDatas.push("22");
realityDatas.push("33");
realityDatas.push("41");
realityDatas.push("51");
Radar.categories = ["1-1", "1-2", "1-3", "1-4", "1-5", "1-1", "1-2", "1-3", "1-4", "1-5"];
Radar.series = [{
name: '',
data: realityDatas
}];
_self.showBar("canvasBar", Radar);
},
showBar(canvasId, chartData) {
canvaRadar = new uCharts({
$this: _self,
canvasId: canvasId,
type: 'line',
legend: true,
fontSize: 14,
background: '#FFFAE8',
pixelRatio: _self.pixelRatio,
animation: true,
categories: chartData.categories,
series: chartData.series,
enableScroll: true, //开启图表拖拽功能
xAxis: {
disableGrid: false,
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
scrollShow: true, //新增是否显示滚动条,默认false
scrollAlign: 'left', //滚动条初始位置
scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
scrollColor: '#DEE7F7', //默认为 #A6A6A6
},
yAxis: {
/* disabled:true */
},
dataLabel: true,
width: _self.cWidth * _self.pixelRatio,
height: _self.cHeight * _self.pixelRatio,
extra: {
column: {
type: 'group',
width: _self.cWidth * _self.pixelRatio * 0.45 / chartData.categories.length
}
}
});
},
x***@sina.com
遇到同样问题 不知道解决了吗
2022-12-26 17:41