javascript - 如何更改 Chartist.js 中图表的线条颜色

标签 javascript html css chartist.js

我目前正在使用Chartist.js,但我无法更改图表的默认线条颜色。

Chartist.js

Sample Chart Image

对于简单线图我已经尝试过:

.ct-series-a .ct-line{
    background-color: blue;
}

但是它没有带来任何结果。如何解决这个问题?

最佳答案

试试这个:

.ct-series-a .ct-line {
  /* Set the colour of this series line */
  stroke: red;
  /* Control the thikness of your lines */
  stroke-width: 5px;
  /* Create a dashed line with a pattern */
  stroke-dasharray: 10px 20px;
}

https://gionkunz.github.io/chartist-js/getting-started.html#customizing-the-default-css

关于javascript - 如何更改 Chartist.js 中图表的线条颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43432120/

相关文章:

javascript - Angular jqlite child 秀

javascript - 同名函数参数和私有(private)变量

css - 如果太长,请使用 “…”修剪文本

javascript - 制作重叠的 div "not clickable"以便可以访问下面的内容?

javascript - jQuery 替换特定文本

Javascript setTimeout 在 Android Samsung S4 上被阻止

html - CSS 页边距内容未出现

javascript - 带有 block 显示的 Canvas 在 div 和 Canvas 元素之间仍然有间隙

javascript - 按键循环按对象数组分组

javascript - jQuery .remove() 不删除 img