我想使用chartist.js,但是我的工具没有显示任何内容:

http://gionkunz.github.io/chartist-js/getting-started.html

我的代码(charts.html):

<html>
  <head>
    <title>My first Chartist Tests</title>
    <link rel="stylesheet"
          href="chartist.min.css">
  </head>
  <body>
    <!-- Site content goes here !-->
    <script src="chartist.min.js"></script>


<script type="text/javascript">

new Chartist.Line('.ct-chart', {
  labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
  series: [
    [12, 9, 7, 8, 5],
    [2, 1, 3.5, 7, 3],
    [1, 3, 4, 5, 6]
  ]
}, {
  fullWidth: true,
  chartPadding: {
    right: 40
  }
});

</script>

  </body>
</html>


我哪里错了?

javascript - chartist.js库不显示任何内容-LMLPHP
解决了

添加此行代码:

<div class="ct-chart ct-perfect-fourth"></div>

最佳答案

添加此行代码:

<div class="ct-chart ct-perfect-fourth"></div>

关于javascript - chartist.js库不显示任何内容,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35389103/

10-12 07:24