score:0
alex almost has it.
should be:
somevar = [{title: "salary", amount: 50},{title: "food", amount: 25},{title: "recreation", amount: 10}]
data = $.map(somevar, function(i) { return [[i.title, i.amount]]; })
$(document).ready(function() {
chart = new highcharts.chart({
chart: {
renderto: 'container'
},
series: [{
type: 'pie',
name: 'expenses',
data: data
}]
});
score:1
i believe you want something like this:
data: $.map(category_transactions_sum, function(i, c) { return [c.title, c.amount]; })
score:1
you can try this (works for me):
temp = $.map(json, function(i) { return [[i.in_time, i.status]]; })
showdata = json.parse(json.stringify(temp, null, ""));
and then use in the series as :
chart.addseries({
data: showdata
});
Source: stackoverflow.com
Related Query
- Use an array of objects for series data in Highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Restructuring array for Highcharts use
- Formatting data array correctly for Highcharts
- convert string into array for highcharts js
- Highcharts display label for pie chart using html table as data source
- Simple, Open source PHP wrapper for Highcharts library
- Pass array from js for loop to highcharts series data
- Extract data series from a JSON array for a Highcharts chart with 2 y-axis
- Multidimensional JSON to javascript array for highcharts
- Rails 3: Creating compact array for highcharts includes nil, but shouldn't
- HTML table as data source for highstock charts using highcharts
- Including source for Alchemy js breaks Highcharts js
- Single column HighCharts for an array
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
- Needing to convert JSON Object to JSON Array for Highcharts
- Using a flask variable as data source for highcharts
- Highcharts Interactivity between plots - looking for code improvements
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Highcharts change or add color for name in a array of point.names and y
- Convert DataTable to array for highcharts
- A different suffix from an array for each line on Highcharts
- Use Node.js as data source for highcharts
- Cannot find proper JSON array syntax for Highcharts
- Why does highcharts not accept an array for second y axis?
- Array for subseries on highcharts Drilldown
- How to represent date array in java script for highcharts
- Change json array format for highcharts
- How to build a JSON data array for Highcharts display - switching values for xAxis/columns
- Using an array for data in highcharts
More Query from same tag
- Highcharts return undefined value at a lot of data
- How to set columnrange width to expand the length of the x-axis in multiple data series in Highcharts
- Multiple categories and series in Highcharts
- Labels string from Asp.net does not distributed in the highchart
- Add custom images in highstock series
- Customize legend pie highchart into tag div
- How can I unescape and remove quot; from data served by rails into javascript
- Highcharts, How to show datatable when export PDF and not show pdf when normal
- Highcharts drilldown on area chart
- container .fadeIn/Out with HighCharts and Leaflet
- High Chart value is not coming on last bar
- change the default distance in between the parallel axis in highchart
- Windows Forms WebBrowser control in different target platform
- $(...).highcharts is not a function despite correct order of files
- Highcharts Highmaps How to import data from google spreadsheet
- Is there a way to have one series name for multiple series without duplicating the series name in the tooltip?
- Add values to rCharts hPlot tooltip
- Install highcharts extenion in yii2 manualy [without composer]
- Need to join x axis and y axis label highcharts
- New Node should be added without changing the position of existing one using highchart
- Highchart: different units per Y axis
- HighCharts : Xaxis lables misplaced
- Different border radius
- How to load the highcharts plugins?
- Disabling Handlebars in HighStock charts navigator
- Production build issue with ChartModule in angular 2
- Highcharts dual axes navigator
- Highcharts - adding a question mark where data is missing in a bar chart
- How to add border-radius to the marker pop
- highcharts donut pie - How to calculate pie size percentages after resize the chart