echarts 隐藏y轴x轴刻度

以你之姓@ 2022-12-09 01:54 516阅读 0赞

效果图
在这里插入图片描述
options的设置

  1. option = {
  2. title: {
  3. text: '已报到情况 '
  4. },
  5. tooltip: {
  6. trigger: 'axis',
  7. axisPointer: {
  8. type: 'shadow'
  9. }
  10. },
  11. grid: {
  12. left: '3%',
  13. right: '4%',
  14. bottom: '3%',
  15. containLabel: true
  16. },
  17. xAxis: {
  18. type: 'value',
  19. show:false
  20. },
  21. yAxis: {
  22. axisLine: {
  23. show: false
  24. },
  25. axisTick: {
  26. show: false
  27. },
  28. data: ['巴西', '印尼', '美国', '印度', '中国']
  29. },
  30. series: [
  31. {
  32. name: '已到达',
  33. type: 'bar',
  34. stack:"one",
  35. barMaxWidth:"20",
  36. itemStyle:{
  37. color:"#2C9DFF",
  38. barBorderRadius:[10,0,0,10]
  39. },
  40. label:{
  41. show:true,
  42. position:"insideRight"
  43. },
  44. backgroundColor:'#E7E7E7',
  45. data: [12, 14, 40, 50, 80]
  46. },
  47. {
  48. name: '总数',
  49. type: 'bar',
  50. stack:"one",
  51. barMaxWidth:"20",
  52. itemStyle:{
  53. barBorderRadius:[0,10,10,0],
  54. color:"#E7E7E7",
  55. },
  56. label:{
  57. show:true,
  58. position:"right",
  59. color:"#000"
  60. },
  61. data: [100, 20, 100, 500, 70]
  62. }
  63. ]
  64. };

重点字段:

  1. yAxis: {
  2. axisLine: {
  3. show: false
  4. },
  5. axisTick: {
  6. show: false
  7. },
  8. },

x轴如何需要文字不需要刻度同理

发表评论

表情:
评论列表 (有 0 条评论,516人围观)

还没有评论,来说两句吧...

相关阅读