快速问一下,我试图在节点模板中使用Chartist.JS显示一个简单的条形图,但似乎在运行脚本时遇到了问题。你们中是否有人知道我的代码出了什么问题,以及如何修复它?提前谢谢。
我的主布局页面:
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
link(rel='stylesheet', href="../bower_components/chartist/dist/chartist.min.css")
body
block content然后包含图表代码的页面:
extends layout
block content
script(src="../bower_components/chartist/dist/chartist.min.js")
h1= title
p Welcome to #{title}
div(class="ct-chart")
script.
new Chartist.Bar('.ct-chart', {
labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'],
series: [20, 60, 120, 200, 180, 20, 10]
}, {
distributeSeries: true
});发布于 2016-06-15 01:34:40
原来代码都很好,问题出在我的NodeJS代码中,我没有正确地路由样式表和脚本文件查找。
https://stackoverflow.com/questions/37817734
复制相似问题