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
- How to change height of ENTIRE xAxis labels using Highcharts?
- is it possible to add verical plot line and show the intersection with the series?
- plotBands Makes the plotLines Disappears highchart
- How to make Javascript file use variable that was sent to Pug view
- How to align Highcharts datetime x-axis with data I pass to it?
- How to set the position of the first and last child of the tooltip
- Highcharts: SeriesMapping with CSV
- Highcharter/Highmap: change legend label format for billions
- Highcharts: Click to Highlight instead of Hide (= Always show non-selected)
- HighCharts in R Shiny App
- HighCharts SyntaxError: missing ] after element list
- How to get total of highcharts multiple series
- how to change highcarts sunburst slice/level without clicking levels
- I need the Y axis values in integer instead of decimal values in Dynamic Chart
- Show only first and last xAxis label in Highcharts
- does highcharts.js have a debug mode?
- Linking Data in multiple Charts Highcharts
- Distinguish borders between line and column chart type
- How to prevent label overlapping? How to write text at a point relative to plotLines?
- Setting Highcharts x axis label's width
- how to pass to or more list of series to set series
- multiple series in Highcharter R stacked barchart
- Remove step line points
- HighCharts – Horizontal chart: moving bars down, make space for labels above them
- how to draw a directed path on a map in highcharts?
- Highchart drilldown to simultaneous multiple series and y-axis
- Spacing bug in tooltip formatter?
- How to adjust vertical labels on this Line Chart?
- highcharts.js change color of the lines in the background
- how to set a rangeSelector for highstock