Tag: chartist.js

把Chartist.JS放入Jade

快速的问题,我试图在一个节点模板中使用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 然后包含chartist代码的页面: 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 });

Jade中不允许使用重复的属性“{”

我试图把一个脚本写入玉,但它不会让我使用多个花括号。 这里是我试图把玉的图表代码。 body h1 Crimes by Category .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 });) 我得到重复属性“{”是不允许的。 我不知道如何解决这个问题。 任何帮助,将不胜感激。