dmtrbrl / vue-trend-chart

Simple trend charts for Vue.js
https://dmtrbrl.github.io/vue-trend-chart/
MIT License
261 stars 29 forks source link

Incorrect formatting xLabels #11

Closed czelsa closed 2 years ago

czelsa commented 4 years ago

when I move data label from data()

  data() {
    return {
      ...
      labels: {
        xLabels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        yLabels: 5,
        yLabelsTextFormatter: val => Math.round(val * 100) / 100
      },

to mounted() like:

  mounted() {
    ...
    this.labels = {        
      xLabels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      yLabels: 5,
      yLabelsTextFormatter: val => Math.round(val * 100) / 100}
  }

then the bottom label (xLabels) overlaps the chart (changes position/moves up)

image

https://codepen.io/czelsa/pen/gOaQzbP