ECharts - Change bar chart line height

Viewed 856

I'm creating a chart using Echarts and it looks like this on my page:

enter image description here

This causes me two issues, the first is that it's really bad to see the data in the graph, so I need to make the bars bigger. The second issue is that the bar labels (on the left) are being cut.

My chart config is similar to this, it only has more data in it:

option = {
  xAxis: {
  },
  yAxis: {
    data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
  },
  series: [{
    name: "Sale",
    type: "bar",
    data: [5, 20, 36, 10, 10, 20, 4]
  }]
}
1 Answers

the solution was simple.

After messing around with both the echarts docs and the Laravel Charts that I was using, i managed to get what I wanted by setting a height property at my chart config. Something like this:

option = {
  xAxis: {
  },
  yAxis: {
    data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
  },
  series: [{
    name: "Sale",
    type: "bar",
    data: [5, 20, 36, 10, 10, 20, 4]
  }],
  height: 2000px
}
Related