score:-1
you are using a for in loop, instead of a for loop.
for(var i in data) {
applications.push("app name " + data[i]['name']);
number.push(data[i].number);
}
should be
for(var i = 0; i < data.length; i++) {
applications.push("app name " + data[i]['name']);
number.push(data[i].number);
}
score:-1
you are getting an array of objects. with jquery, you can approach the 2 arrays like this:
var data = [{"name":"messenger","number":"29"},{"name":"viber","number":"28"},{"name":"facebook","number":"28"},{"name":"skype","number":"17"}];
var names = [];
var numbers = [];
$.each(data, function(i, row) {
names.push(row.name);
numbers.push(row.number);
});
Source: stackoverflow.com
Related Query
- Split JSON into two arrays gives undefined keys-values
- Undefined values in chart.js from json
- Chart.js legend - split into two and display separately?
- How to wrangle JSON data into arrays of unknown name
- Ng2-Charts Linechart only showing first 2 two values
- Is it possible to combine two Y axes into a single tooltip with ChartJS 2?
- Is there a JavaScript Method/ Function to loop Objects via Keys into a array?
- Loading an external JSON into ChartJs
- Parsing JSON data into Chart.js bar chart
- Chart.js two Y-Axis, one with negative values
- Chart.js tooltip values display in two lines
- Importing data from Model into a View gives me an error I cannot solve
- Chart.js plotting two json datasets on a line chart
- Bar values in Chart.js 2.X - dataset.metadata undefined
- How to map json array to two different array for chart
- Angular / ng2-charts: Fetching json data in chart object showing: Cannot read property 'length' of undefined
- Chartjs Bar chart shows undefined values
- How can I show JSON data in Chart.js with Javascript if static values are working but dynamic from mySQL are not?
- Sort one array and keep other two arrays in sync
- Convert two lists into a dictionary of X and Y Format
- Load data from a JSON object into an array
- Using two JSON objects to make Chart.JS Bar Chart Dynamic in Typescript / Angular
- How to Convert an Array of Objects into an Object of Associative Arrays in Javascript
- Converting JSON data into Chart.js array from strings
- Chart JS - How to output JSON objects into PIE variant
- Get method in php then pass the value into json format
- ChartJS and JSON result: Cannot set property 'fillColor' of undefined
- Passing JSON data from PHP array into ChartJS
- JavaScript Chart.JS - issue keeping charts in two rows, instead everything in stacked into one column
- Using Chart.js onClick function, can you execute code from an undefined or null result?
More Query from same tag
- Proper way to use a counter variable in HTML/Javascript
- destroy method implementation in pie chart chartjs
- Render labels only when the data is available for a particular label
- how does this javascript recolor the doghnut?
- chartjs bar chart filter using datetimepicker
- Chart.js - Line Chart format data to Lacs/Crores
- Tooltip does not appear
- Unable to set width and height on canvas in chart js
- Chart js with problems when using too many series
- Charts.js Multi Line scales. See value curve
- refresh chart data every second javascript
- How to sum the array value in javascript like chartjs data array and input value sum
- Chart JS tooltips diffrent colors for label
- skipping and merging similar data ecto elixir
- Single Point Curve Chart.js
- data representation using charts
- How to import Chart.js with Webpack
- Resizing chart before downloading as image
- How to use data from database for chart.js (bubble chart) with Ajax/JSON method?
- Chart.js 3.3.0 - Draw text on top of chart
- ng2-charts access base chart object
- $scope.chart undefined in angular-chart
- Chart.js line chart does not render data lines on iOS
- Multiple Charts of the Same Type in ChartJS2 ReactJS - Buggy Tooltips
- How to draw one line with different colors in chartjs2?
- How to move a chart.js to the center
- Chart.js v2 formatting time labels
- Update Chart.js plugin
- chart.js combine scatter and line
- Chartjs scatter chart's x axis is heavily padded