score:53
you were close to it !
actually, the attribute you have to edit is not linewidth
but borderwidth
(in the first example of chart.js docs, you can see the attribute).
as stated in the example of the mdn doc of
lineto
:
use the beginpath() to begin a path to draw a line on, move the pen with moveto() and use the stroke() method to actually draw the line.
the line is basically a rectangle with a width of 0
. then the width of the line is calculated using the rectangle border width.
so you simply have to edit your dataset this way :
datasets: [{
// ...
borderwidth: 1 // and not linewidth
// ...
}]
i also have updated your fiddle with the edit, and you can see that it is working now.
score:2
if this helps, or you still discern this method as presentable you can set the borderwidth relatively high like 50.
datasets:[{
borderwidth: 50
}]
//at your options put this
options: {
legend: {
display: true,
labels: {
fontsize: 16, //point style's size is based on font style not boxed width.
usepointstyle:true,
}
}
you check usepointstyle
at the docs https://www.chartjs.org/docs/latest/configuration/legend.html#legend-label-configuration
Source: stackoverflow.com
Related Query
- How can I make two of my lines in Chart JS thicker
- How can I make lines fully connected in a multi-line chart even when one dataset is more sparse than another?
- How can I make a stepline or stepped chart in chart.js or D3?
- How can I make line on chart thinner?
- How can I make small grid lines above ChartJS labels?
- How can I make streaming chart with react?
- How can I get my Chart.JS bar chart to stack two data values together on each bar, and print a calculated value on each bar?
- how can I make selected data is highlighted on chart js?
- Can I make a horizontal bar chart with two category axes?
- Chart.js How can i make a horizontal lines like this?
- How can labels/legends be added for all chart types in chart.js (chartjs.org)?
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- Chart JS Fill Between two lines
- How to display data labels outside in pie chart with lines in ionic
- How can I remove extra whitespace from the bottom of a line chart in chart.js?
- how to make a chart.js bar chart scrollable
- Chart js: how can I align the legend and the title
- how to programmatically make a line chart point active/highlighted
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- How can I trigger the hover mode from outside the chart with charts.js 2?
- How to make Chart JS responsive?
- How to make bar chart animation where all bars grow at the same speed?
- How can I add some text in the middle of a half doughnut chart in Chart.JS?
- How to add background color between two lines in yAxis Chartjs
- How to make a chart scroll horizontally (when using Chart.js)
- How can I rotate a pie chart in charts.js?
- How to map json array to two different array for chart
- How to make a chart with an associative array with chart.js?
- How can I achieve displaying data points on chart but Dotted? Chart.js V3.7.0
- Chart is too big. How can I reduce size for the chart in vue js?
More Query from same tag
- How To Use Api Data With Vue Chart.js
- how to use chart.js with react Hook?
- Error passing custom options to radarChartJS
- chart js 2 how to set bar width
- Chartjs box plot with Y-axis negative values
- How to fix size of mixed chart with bubble chart in Chart.js?
- Make Chart.js Radar labels clickable
- Add data to dynamically created Chart.js dataset
- Plot a Line chart using Chart.js with CSV Data
- Render Chart.js on backend side ASP.NET
- Color the bars using Angular-Chart.js
- How to set min max for x axis depend on data with Chartjs and Spring Boot?
- Array value is not being passed to the plugin
- chart js label not showing
- Options beginAtZero doesn't work in angular-chart.js
- Horizontal overlapping of bars, not whole graph
- ChartJs different data for Tooltips
- How to adding data in loop and display chart dynamically like in live (chart.js & typescript & angular)?
- I want to put bar of different color by the values in chart.js
- Correlating separate elements with different heights to line up along vertical center line
- Updating chart.js chart with dataset of different size
- how to set color of label in chartjs?
- Retrieve value returned from a function in Angular
- How can I get the active label element on click in ChartJS?
- Ajax reload data chat.js showing error on mouse hover on graph
- I want to show the value of label inside the pie graph. (vue-chartjs / pieceLabel)
- How to inject “Chart.js” to my module?
- How to change bar color acording to label value in chartjs
- Chart.js sciptable options: accessing the values of the data object?
- Change ChartJs axis title dynamically