I'm currently using Chartist.js
, But I can't change the default line colors of Chart.
Chartist.js
For SIMPLE LINE CHART
I've tried:
.ct-series-a .ct-line{
background-color: blue;
}
But It brings no result. How to fix this?
We can use the borderColor property of the dataset to change the color of the line that exists in a line chart. You can assign a color to it in hex or RGBA format. It will take the color and apply it to the lines of a chart created using Chart.js. datasets: [ { label: 'label', data: [90, 40, 50, 70], borderColor: "#084de0" }]
How to Use Chart.js? Chart.js is easy to use. The canvas element must have a unique id. That's all! options: {...} options: {...} If you set the borderColor to zero, you can scatter plot the line graph:
options - options for the whole chart The line chart allows a number of properties to be specified for each dataset. These are used to set display properties for a specific dataset. For example, the colour of a line is generally set this way.
A vertical line chart is a variation on the horizontal line chart. To achieve this you will have to set the indexAxis property in the options object to 'y' . The default for this property is 'x' and thus will show horizontal lines.
Try this:
.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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With