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

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]
}]
}
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With