2017-08-24 124 views
0

我试着去我的网站上使用morris.js,他们有一个简单的例子官方网站:morris.js我跟着,安装与NPM包,但是,在我的HTML莫里斯不发现我不明白,从控制台的任何错误,只是没有看到什么,任何人都知道可能会发生什么?我使用Node.js的0.10,而且其我的代码:Morris.js没有找到

(IM使用单页应用程序)

的index.html

...

<!-- Morris.js --> 
    <link rel="stylesheet" href="node_modules/morris.js/morris.css"> 
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> 
    <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> 
    <script src="node_modules/morris.js/morris.js"></script> 

    ... 
    <body>  
     <div data-ng-view> 
     </div>      
    </body> 
    ... 

page.html

 <div id="myfirstchart" style="height: 250px;"></div> 

     <script> 
      new Morris.Line({ 
       // ID of the element in which to draw the chart. 
       element: 'myfirstchart', 
       // Chart data records -- each entry in this array corresponds to a point on 
       // the chart. 
       data: [ 
        { year: '2008', value: 20 }, 
        { year: '2009', value: 10 }, 
        { year: '2010', value: 5 }, 
        { year: '2011', value: 5 }, 
        { year: '2012', value: 20 } 
       ], 
       // The name of the data record attribute that contains x-values. 
       xkey: 'year', 
       // A list of names of data record attributes that contain y-values. 
       ykeys: ['value'], 
       // Labels for the ykeys -- will be displayed when you hover over the 
       // chart. 
       labels: ['Value'] 
      }); 
     </script> 

node_modules我proyect

node_modules on my proyect

而且我的网页的白色空间的结果。

回答