score:0
first you should aggregate your data returned from the database.use the sum() function.the correct format should be this:
date | member
-------------------
2016-06-23 | 5
2016-06-24 | 10
in the controller you should have an array.
data = [{date:"2016-0-23",member:5},{date:"2016-06-24",member:10}];
to create a simple chart you need the data and labels.
vm.labels = data.map(function (property) {return propery.date;});
vm.data = data.map(function (property) {return propery.member;});
on the html page:
<canvas id="line" class="chart chart-line" chart-data="vm.data" chart-labels="vm.labels"></canvas>
Source: stackoverflow.com
Related Query
- Angularjs line chart get data from sql
- angular 4 line chart data is not showing data from http get
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How to get chart from data points (arrays) with inconsistent time intervals and chart.js?
- How to get Data from API to display chart using chartjs in Vuejs
- Chart.js: get chart data from canvas
- How to split data from api to get a chart
- How to get line x value from Label chart js
- get JSON data from function to give value to Chart JS
- How to add data dynamically to primevue Line chart from vuejs3?
- how to insert dynamic data from sql into chartjs stacked bar chart javascript
- Changing chart data dynamically with C# from SQL database
- How to bind data from Controler to chartjs line chart to create it as dynamic?
- getting additional value fields from data source for dx.chartjs doughnut chart
- Created an onclick function to remove data from a line chart in ChartsJs, but getting "Cannot read property 'data' of undefined" error
- Create a line chart using an user input table from a data table in chart.js
- Multiple axis line chart with Chart.js and JSON data from Google Sheet
- Chart.js - add data to line chart from clicking pie chart segment
- Get data from sql database in chartjs using codeigniter
- Chartjs random colors for each part of pie chart with data dynamically from database
- line chart with {x, y} point data displays only 2 values
- Get Chart js object from selector
- Adding Chart.js line chart to Jinja2/Flask html page from JS file
- Show data dynamically in line chart - ChartJS
- ChartJS: Draw vertical line at data point on chart on mouseover
- How can I remove extra whitespace from the bottom of a line chart in chart.js?
- ChartJs line chart - display permanent icon above some data points with text on hover
- How to use 'time' (data from database, data type: timestamp ) for plotting graph in Chart JS
- React ChartJS 2 : Get data on clicking the chart
- Mouse over on line chart data active other data-set in Chart.js
More Query from same tag
- Display labels on bar chart using Chart.js
- Chartjs duration horizontal bar chart
- React chart2js Line chart with multiple datasets overlapping
- ChartJS2 in Ionic2
- Chart.js custom tooltipTemplate index
- Chartjs dynamic chart return both x & y axis undefined
- Chart.js - Styling Legend
- ChartJS scatterplot multi-line tooltip, one box
- Using data saved as a variable in HTML from Python
- Background-color for area below line chart in chartJs?
- Click every label onload ChartJS
- How to put back the data with a switch?
- Styling problems with Chart.Js
- Chart.js Line Graph: Start a line in the middle of a graph
- Chart.js animations ignoring global default configuration
- AJAX request not working unless alert() is used
- Chart.js: different dataset size
- Cannot create chart on react element
- Chart.js is always increasing height on chart.resize()
- How to reduce the number of data points displayed in react-chart-js2 (data decimation)
- Display all labels in Chart.js
- ChartJS re-rendering bug
- Is there an option in chart.js to hide values in the graph legend
- Chartjs barchart generate data for an array dataset
- How to make chartJs stacked bar always rounded when data is 0?
- How to fill remaining polar area with color
- Click on chart to expand more information - Chart.js
- Update Chart vue3-chart with new data
- Do not draw line on condition in ChartJS line chart
- ChartJS donut chart clipping the edges