score:0
Accepted answer
try formatting your output. something like below should work.
labels: @string.join(",", model.select(x => $"'{x.namearea}'"))
so basically what this is doing is instead of a foreach we are selecting just the name area from all of the models in your list. that select is also adding single quotes around your namearea using string interpolation. from there we are doing a join to comma delimit the list.
hopefully this works for you.
Source: stackoverflow.com
Related Query
- How to split a List into View in C#
- How to add ChartJS code in Html2Pdf to view image
- How to loop over Chart.js with Django list view
- How I can use a list of a string array in JavaScript into blade view?
- How to run Chart.js samples using source code
- How to add labels into Chart.js canvas plugin?
- How to feed hour and minute data into chartJS
- How do I import a csv into chart.js?
- How put dataset labels into multiTooltipTemplate?
- How to import Chart.js chartjs-plugin-datalabels npm package into an Angular 7 project
- how to use alpha vantage api in Instead list in chartjs?
- Importing data from Model into a View gives me an error I cannot solve
- Chart.js - How to push a collection of array into dataset
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- How to add null value rows into pandas dataframe for missing years in a multi-line chart plot
- how can i send a list of numbers from views.py to a chartjs file im using for the front?
- Passing an Array from a Flask view to the javascript code of another view
- How to fit Doughnut Chart JS into Bootstrap column?
- How to Convert an Array of Objects into an Object of Associative Arrays in Javascript
- Chart JS - How to output JSON objects into PIE variant
- How to generate color code dynamically by swapping 2 characters within a string using PHP
- How to get the database data into ChartJS using codeigniter
- React input to filter to chart. How convert a hardcoded number into a variable?
- ChartJs how can I move bar into new group?
- How to display variables from Laravel controller to view javascript with specific index
- How to write better code in es6 for formatting an object with array values
- How change all dates in array into date without time - laravel
- how to reduce list chart to one and use select dropdown to show selection without refresh page?
- How to split data from api to get a chart
- How to chnage this value theHour[0].times into time format (HH:mm) using moment.js
More Query from same tag
- export 'h' was not found in 'vue'
- Change bar color depending on value
- Chart changes different on zoom when using multiple charts with chart.js and flask
- ChartJS: Percentage labels
- I can't change the color of the grids in Chart.js
- How can I display the percentage inside the graph and on hover?
- ChartJs functional component does not refresh even when forceUpdate
- Chartjs not showing chart
- how to creat a dynamic datasets and new dynamic multi yAxes
- Moving the zerolines in ChartJS scatter chart
- How to position yAxes labels in chartJS
- ChartJS time axis not plotting correctly | getting an hour instead of date
- Can Chart.js combines Line Chart and Bar Chart in one canvas
- How we can draw a circle in bar chart
- chart.js API returns bad x and y points
- ChartJS not showing from MySQL
- Get access to the chart.js component instance in React
- Aligning zero on y axis to the labels on x axis of line chart in chartjs
- Pushing API Data into Chart.js
- Chart.js responsive option - Chart not filling container
- Skipping the initial animation of a line chart
- How to create multiple y-axis time series chart
- Create a pie chart with chartjs package in R
- How to change ChartJS font size with javascript?
- Chartjs - display radarchart lines from center to corner value
- Avoid data resetting when toggling series
- Vue-chartjs: Re-render a chart even if data hasn't changed
- In Chart.js multibar graph, is there a way to highlight a single category?
- Chart.js just disappears for no reason
- Multiple line types in ChartJS