score:13
Accepted answer
To remove the stroke from legend, you need to set borderWidth
property to 0
for your dataset, like so ...
datasets: [{
borderWidth: 0,
...
}]
ᴡᴏʀᴋɪɴɢ ᴇxᴀᴍᴘʟᴇ ⧩
var ctx = c.getContext('2d');
var chart = new Chart(ctx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
datasets: [{
label: 'Statistics',
data: [3, 1, 2, 5, 4],
backgroundColor: 'rgba(0, 119, 204, 0.1)',
borderColor: 'rgba(0, 119, 204, 0.8)',
borderWidth: 0 //<-- set this
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
<canvas id="c"></canvas>
Source: stackoverflow.com
Related Query
- Change Legend Box Outline Chart.js 2
- chart js how to fill legend box with colour
- Chart.js - change which data the legend uses for the coloured box
- how to change point style legend to diamond in chart js
- Change the color of the legend box and the color of the x grid lines in chart.js
- VueJS + Chartjs - Chart only renders after code change
- Cannot change font color and box width in chart
- Donut Chart : Trigger legend or pie click event while selecting outside filter state change
- change legend in chart in report builder
- How to add a coloured legend box to a pie chart with Chart.js v1?
- Chart Js Change Label orientation on x-Axis for Line Charts
- Chart.js - Increase spacing between legend and chart
- Pie Chart Legend - Chart.js
- Change legend position of ng-charts (using angular2)
- Chart Js change text label orientation on Ox axis
- chartjs datalabels change font and color of text displaying inside pie chart
- Chartjs Bar Chart Legend
- Chart.js change legend toggle behaviour
- Change Chartjs Legend Icon Style
- Chart js. How to change font styles for "labels" array?
- ChartJS bar chart with legend which corresponds to each bar
- How to change the color of legend in chartjs and be able to add one more legend?
- How do I change the 'months' language displayed on the date axis in Chart JS?
- Chart.js HTML custom legend issues with doughnut chart
- Angular 2 chart - change point radius
- Change Radius/Point size of Legend Points in chart.js when usePointStyle is true
- How to remove rectangle box next to the legend text in Chart.js
- Change labels colors for radar chart js
- Chart js: how can I align the legend and the title
- How to change color of hidden legend item instead of strike-through in Chart.js
More Query from same tag
- ChartJS - Labels background
- How can labels/legends be added for all chart types in chart.js (chartjs.org)?
- charts.js chart showing old data on hover
- Chart.js - cannot fetch result from MySQL via PHP
- How to remove legend at the bottom of chartjs doughnuts
- ChartJS how to sync animations when page loads
- Chart load time and animation slow on mobile device
- Chartjs labels position
- HTML Canvas height defaults to 1 after slideToggle
- Click event using Chart.js with AngularJS
- Chartjs-gauge create circumference until certain value from data
- chartJS line chart not plotting values that are less than minY
- Adding responsive text inside chart in Charts Js
- Second tab doesn't show the chart . Can anybody see why?
- Fully destroy charts on ngDestroy method from Angular 4
- Show labels on each sector to polar chart using angular js chart
- Chart.js only appears randomly, and disappears on page refresh
- Chart JS dataset disabled by default
- Updating chart.js not working after recieved new data from database with ajax
- Why aren't my data points getting placed in the corresponding locations in my chart?
- How can I cause a legend to appear to the right of the pie (Chart.JS)?
- js devexpress PieChart Series color runtime
- pan on chart.js also zoom on line charts
- How to dynamically set ChartJs line chart width based on dataset size?
- How to display k as thousand for the values of chart.js - Javascript
- In chart.js, how to know if a yAxes tick is bumping/rendering over/into another
- Chart.js barchart custom on hover method
- Chart.js Bar graph will not start at zero as minimum value
- How can i change a numpy.ndarray to point format with curly brackets - Python 3.7
- How do I loop under Chart js in JavaScript for multiple axis?