Freddoctor opened a new issue #9456: 离散的X轴 时间段不连续 URL: https://github.com/apache/incubator-echarts/issues/9456 One-line summary [问题简述] 散点图中,离散字段X轴(category type),后台时间分为timeRange: "2018-11-22 09:25:00~2018-11-22 11:30:00~2018-11-22 13:00:00~2018-11-22 15:00:00" 需求为x轴显示4端区间,中间断开的11:30 自动连接到13:00 中间不要有线段连接,而是直接以11:30为起点,展示13:00值. Version & Environment [版本及环境] ECharts version [ECharts 版本]: 4.0.4 Browser version [浏览器类型和版本]: Chrome 68.0 or Firefox 52.9 OS Version [操作系统类型和版本]: Windows 7 Expected behaviour [期望结果] 可以使用 ECharts option [ECharts配置项] var option = { title: { left: 0, text: '', }, tooltip: { trigger: 'axis', axisPointer: { type: 'cross', triggerOn:"none", crossStyle: { color: "#3285ea", type:"solid" }, snap:true, }, // formatter:function(params){ // return params[0].marker+ params[0].seriesName + " " + params[0].data[1]; // } }, axisPointer: { show:true, type:'line', triggerOn:"mousemove", lineStyle:{ color: "#3285ea", }, snap:true, }, grid: [{ left: '2%', right: '7%', }], xAxis: { type: 'category', boundaryGap: true, left: 0, data:dateArr, axisLabel: { //调整x轴的lable textStyle: { fontSize: 20, // 让字体变大 color: '#3E454D' }, }, axisTick:{ show:true, //是否显示坐标轴刻度。 alignWithLabel:true, //类目轴中在 boundaryGap 为 true 的时候有效,可以保证刻度线和标签对齐 interval:1, // length:1, showMinLabel:true, showMaxLabel:true, } }, yAxis: { position: 'right', name:"分时", axisLabel: { //调整x轴的lable textStyle: { fontSize: 20, // 让字体变大 color: '#3E454D' } }, splitLine: { lineStyle: { color: '#1a1e24', width: 2 } }, splitNumber: 3, type: 'value', boundaryGap: [0, '100%'], min: min, max: max }, series: [{ name: '分时', type: 'line', smooth: true, symbol: 'none', sampling: 'average', itemStyle: { normal: { color: '#84b3ff' } }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#2b3c59', opacity: 0.2 }, { offset: 1, color: '#2b3c59', opacity: 0.2 }]) } }, data: timeRange } ] };
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
