宽度变小,x轴第一个和最后一个刻度不显示
General Questions
Issue Type
- [ ] I have a question to ask about how to use ECharts to ...;我想提问如何使用 ECharts 实现某功能
- [x ] I have a bug to report;我想要报 bug
- [ ] I have a feature to request, e.g.: I'd like a new feature that ...;我需要一个新功能
- [x ] I have a feature to enhance, e.g.: The current feature should be improved in the way that ...;我希望改进某个功能
- [ ] There's something wrong with the documents;文档有些问题
- [ ] Others, or I'm not sure which issue types to choose here;其他,或我不知道应该选什么类型
Issue Details
宽度变小,x轴第一个和最后一个刻度不显示
Expected Behavior
宽度变小,x轴第一个和最后一个刻度显示
Current Behavior
Online Example
option = {
legend: {
data:['Accuracy','Precision','Recall','F1'],
bottom: 0
},
grid: {
left: '2%',
right: '2%',
bottom: '3%',
top: '5%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: true,
axisLabel: {
interval: 0,
formatter:function(value,index)
{
if (index % 2 != 0) {
return '\n\n\n\n' + value;
}
else {
return value;
}
}
},
data: [ "maxDepth:2\nsubsamplingRate:1\nmaxBins:10\n",
"maxDepth:2\nsubsamplingRate:1\nmaxBins:20\n",
"maxDepth:2\nsubsamplingRate:1\nmaxBins:40\n",
"maxDepth:4\nsubsamplingRate:1\nmaxBins:10\n",
"maxDepth:4\nsubsamplingRate:1\nmaxBins:20\n",
"maxDepth:4\nsubsamplingRate:1\nmaxBins:40\n",
"maxDepth:6\nsubsamplingRate:1\nmaxBins:10\n",
"maxDepth:6\nsubsamplingRate:1\nmaxBins:20\n",
"maxDepth:6\nsubsamplingRate:1\nmaxBins:40\n"]
},
yAxis: {
type: 'value',
min: 0.92
},
series: [
{
name: "Accuracy",
symbol: "rect",
symbolSize: 8,
type: "line",
data: ["0.939774", "0.938081", "0.938081", "0.952385", "0.946081", "0.952978", "0.954671", "0.944978", "0.940367"]
},
{
name: "Precision",
symbol: "triangle",
symbolSize: 8,
type: "line",
data: ["0.949789", "0.944585", "0.944585", "0.958703", "0.950645", "0.955724", "0.958296", "0.949663", "0.945291"]
},
{
name: "Recall",
symbol: "pin",
symbolSize: 8,
type: "line",
data: ["0.939774", "0.938081", "0.938081", "0.952385", "0.946081", "0.952978", "0.954671", "0.944978", "0.940367"]
},
{
name: "F1",
symbol: "circle",
symbolSize: 8,
type: "line",
data: ["0.939830", "0.937858", "0.937858", "0.952366", "0.945999", "0.952972", "0.954820", "0.944831", "0.940255"]
}
]
};
Topics
Anything Else We Need to Know
Environment
- ECharts version;ECharts 版本: {DESCRIBE_HERE} 4.1.0
- [ ] It happens only on certain browsers or operating systems. 对于特定浏览器或操作系统才会出现的问题,请提供相应环境信息:{BROWSER_VERSION_OR_OS_INFORMATION_HERE}
http://echarts.apache.org/option.html#xAxis.axisLabel.showMinLabel http://echarts.apache.org/option.html#xAxis.axisLabel.showMaxLabel
@Ovilia 你好,感谢您的帮助,我添加了showMinLabel: true和showMaxLabel: true后,第一个和最后一个刻度可以显示了,但是第二个刻度不再显示
因为显示不下了吧?
@Ovilia 应该不是放不下,不清楚什么原因

这个问题之前修复过,你试试 4.2.0-rc.2 版本?
@Ovilia 试了一下4.2.0-rc.2,还是不行。
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!