score:32
Accepted answer
Your code is correct and you will be able to align the legend as following in the future:
legend: {
position: "top",
align: "start"
}
But the feature is currently not implemented at the current time (2019-03-30). The feature is already merged and will be released with version 2.9. You either have to wait until version 2.9 will be released or use a development release, which is not recommended as they should only be used for testing purposes.
score:1
with version 2.9 as suggested in the documentation, use the plugins namespace for e.g.
this.piechart = new Chart(this.ctx, {
type: 'pie',
data: data,
options: {
plugins: {
legend: {
position: 'right',
align: 'center'
}
}
}
});
Source: stackoverflow.com
Related Query
- Chart.js legend alignment left side
- Remove additional white space on left and right side of Angular Chart
- How can I move chartJs legend left side and change the width and Hight of the chart?
- chartjs bar chart align the legend to left position
- Chart.js - Increase spacing between legend and chart
- Pie Chart Legend - Chart.js
- Chartjs Bar Chart Legend
- chart js how to fill legend box with colour
- ChartJS bar chart with legend which corresponds to each bar
- ChartJs bar chart - keep bars left instead of equally spread across the width
- Chart.js HTML custom legend issues with doughnut chart
- Chart js: how can I align the legend and the title
- Increase padding between legend and chart with react-chartjs-2
- Chart,js Pie Chart can the gap between a pie chart and the legend be adjusted
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- Chart.js Radar chart legend label font size doesn't work
- Using Chart.js - Creating Legend for Doughnut Chart
- Angular chart how to show the legend data value by default along with legend name
- Draw a horizontal bar chart from right to left
- Chart.js: Pie chart legend "onclick" gets overwritten by "options.onclick" if both are present
- Chart JS Legend Styling
- Chart.js chart onclick disables legend onclick
- chartjs Adding percentages to Pie Chart Legend
- chartJS label on each side of the chart
- Chart Js update legend boxes of graph with graph line style
- ChartJS horizontal chart display legend on each bar
- Chart.js legend alignment
- React chartjs-2 - Increase spacing between legend and chart
- Place tooltip on the outer side of the doughnut chart
- how to add percentage value to legend field in pie chart using chart.js
More Query from same tag
- Setting Chart.js Pie-Graph Options
- How to parse data to graph in MVC
- Changing the base of the logarithmic scale in Chart.js
- Bar Color In Chart JS
- Blazor server-side Chartjs
- Chart.js not working - Uncaught RefernceError:
- JSX element type 'Line' is not a constructor function for JSX elements
- Chart.js: changing tooltip template
- How to pass a array from node to .js file (pugJs)
- Show date on xAxes without labels
- How to change position from absolute to relative in charts in ChartJS
- Change the hover data value from to string
- chartjs - how to set the order in which the different charts are displayed
- Adding different point style to each column from parsed csv in chart.js
- React without npm - is it possible to import libraries / modules?
- How can I customize p:polarAreaChart tooltips?
- Why I don't see the second plot?
- create a multi line chart using Chart.js
- what is error can't acquire context from the given item?
- How do I make a pie chart showing number of people in an age group with JSON and ChartJS?
- How can I add a euro sign (€) to all tooltips in my chart js line chart
- Align lines and bars in a mixed chart
- Chart.js how to get Combined Bar and line charts?
- Chartjs Legend Styling
- ChartJS x axis title not visible when axis position is centered
- Drawing line chart in chart.js placing dots only when value changes
- How do I make the Line in ChartJS not exceed the maximum of yAxes
- chart js onclick function call
- Chart.JS Get Json data for chart and return dataset where a type equals a certain type
- Chart JS version 3 not showing in pdf for engine wkhtmltopdf