user2059600
user2059600

Reputation:

Morris.js line graph x-axis labels disappear after resize

X-axis labels dissapear after resize. Tried changing xLabelMargin, but it doesnt solve the problem. Could you help me please?

Before resize: http://prnt.sc/b5evpw After resize: http://prnt.sc/b5evuo

My graph:

<script>
    var months = ['Sausis', 'Vasaris', 'Kovas', 'Balandis', 'Gegužė', 'Birželis', 'Liepa', 'Rugpjūtis', 'Rugsėjis', 'Spalis', 'Lapkritis', 'Gruodis'];
    var data = JSON.parse('{{ $data }}');
    var linegraph = Morris.Line({
          element: 'linegraph',
          data: data,
          xkey: 'month',
          ykeys: ['income', 'expenses'],
          labels: ['Pajamos', 'Išlaidos'],
          xLabelFormat: function (x) { return months[x.getMonth()]; },
          xLabelAngle: 45,
          hoverCallback: function (index, options, content, row) {
            return  "<span style='color:rgb(11, 98, 164)'>Pajamos "+ row.income + "</span><span style='color:rgb(122, 146, 163)'><br> Išlaidos " + row.expenses + "</span>";
          },
          resize: true
        });
</script>

Upvotes: 0

Views: 917

Answers (1)

Anil
Anil

Reputation: 589

I had the same problem. After using parseTime:false its working fine for me

Upvotes: 2

Related Questions