vue-chartist icon indicating copy to clipboard operation
vue-chartist copied to clipboard

Odd issue with simple line graph

Open cfjedimaster opened this issue 5 years ago • 4 comments

I just started using vue-chartist and I'm getting an odd "bowtie" effect with a line chart.

image

Here's the code I'm using:

<template>
  <div>
    <vue-chartist :data="pageViews" :options="options" 
    type="Line" />
  </div>
</template>

<script>
import VueChartist from "v-chartist";

export default {
  name: "App",
  components: {
    "vue-chartist": VueChartist
  },
  data() {
    return {
      pageViews: {
        labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
        series: [
            [5, 2, 4, 2, 0]
        ]
      },
      options: {
          fullWidth: true,
          width: 600,
          height: 300,
          lineSmooth:false
      }
    };
  }
};
</script>

Any idea why I'm seeing this?

cfjedimaster avatar Jan 27 '20 19:01 cfjedimaster

Hey @cfjedimaster I ran into a similar issue with a different chartist wrapper for Vue.js - you seem to be missing the CSS to display the chart properly.

See https://github.com/Yopadd/vue-chartist/issues/34.

Should be easy to verify by putting the Stylesheet in the view with <link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">.

rthaenert avatar Feb 11 '20 09:02 rthaenert

Thank you- I can confirm this fixed it. But this is still a bug in the library, right?

cfjedimaster avatar Feb 24 '20 22:02 cfjedimaster

@cfjedimaster No the css usually comes seperately to avoid duplication.

sugoidesune avatar Dec 16 '20 14:12 sugoidesune

But this isn't documented - not that I can see. Shouldn't it be?

cfjedimaster avatar Dec 16 '20 15:12 cfjedimaster