score:17
If you have that series data in an array, you can process it as follows:
var myData = [18, 635, 21, 177, 20, 165, 22, 163, 24, 162, 25, 145, 19, 143,
23, 139, 26, 112, 27, 110, 28, 104, 30, 91, 29, 88, 31, 68, 32,
57, 36, 55, 34, 53, 33, 51, 35, 46, 37, 44, 39, 42, 43, 39, 42,
39, 41, 38, 38, 37, 44, 36, 45, 34, 48, 31, 40, 31, 47, 27, 49,
23, 46, 21, 50, 21, 52, 17, 55, 17, 53, 16, 51, 15, 54, 12, 58, 6,
57, 6, 59, 4, 63, 4, 56, 3, 62, 2, 64, 2, 100, 2, 68, 1, 78, 1, 60,
1, 97, 1, 70, 1, 65, 1, 69, 1, 71, 1];
var mySeries = [];
for (var i = 0; i < myData.length; i++) {
mySeries.push([myData[i], myData[i + 1]]);
i++
}
Once you have your series data in 'mySeries', you can just set your chart data using:
series:[{
data: mySeries
}]
Alternatively, if you want to add the data after rendering the chart, you can add the series data dynamically using:
chart.series[0].setData(mySeries);
http://jsfiddle.net/Cm3Ps/ (press the 'Add My Data' button).
score:2
Actually, the function requires parameter as array of int.
Assume you get a function
drawChartFunction(data) {
// some code here
series: [{ data: data}]
}
You can try it:
array = {9,8,7,6}
var series = [];
for (var i = 0; i < array.length; i++) {
series.push([i, array.[i]]);
}
After the for
executed, your series
likes
0,9
1,8
2,7
3,6
Then, you call drawChartFunction(series)
So your chart is drawn by using 4 points 0 1 2 3
with their values 9 8 7 6
Source: stackoverflow.com
Related Query
- Highcharts series data array
- Use an array of objects for series data in Highcharts
- Highcharts series data array not working
- Highcharts Tooltip - Access "z" value in series data array
- 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
- Highcharts series visibility with csv data source
- How to have multiple highcharts with different series data in vuejs without repeating code
- Highcharts : Display static Y axis labels from array when series data is null , else auto generated label
- Filtering through highcharts series data array
- Highcharts displays series names but missing data points from json source
- Set Additional Data to highcharts series
- Proper way to remove all series data from a highcharts chart?
- Changing data dynamically for a series in Highcharts
- Add additional data to a Highcharts series for use in formatters
- Get Highcharts Series Data after Load
- Highcharts doesn't display series with lots of data points
- Highcharts data series issue with ajax/json and PHP
- Changing Highcharts data series type dynamically
- Highcharts how to use JavaScript variable as series data source?
- How to get multiple data series into Highcharts
- Highcharts with JSON data and multiple series
- Highcharts - Provide URL's for series data to open clickable link
- Find number of data points in each series in highcharts
- How get data name in Highcharts pie chart legend instead of "Slice" using array of values?
- Sort the series data for every X-Axis in Highcharts
- Highcharts : Showing wrong color in data series
- Changing data in HighCharts series causes y-axis to blow up
- How to hide one series data info in tooltip using highcharts
- Highcharts - Global configuration with common code and unique data & Headings
More Query from same tag
- how to add an color picker control to highchart for changing the color of series by user
- Use an array of objects for series data in Highcharts
- Highstock Shared Tooltip This Index
- highcharts tooltip format millions billions
- convert string into array for highcharts js
- Manipulate arrays into different formats
- Dotnet.Highcharts error in export image
- highcharts positioning and colour
- Highstock: How do i display the series name along the line
- Tooltip is not hidden after formatting in highchart
- How can I move x axis of highchart in a particular time period?
- Highcharts - Small column not clickable when covered with a (sp)line serie
- highcharts not working properly
- Update chart border color with plotband color in angular gauge
- Highchart + IE = Greyscale Exports?
- Highcharts modify stacklabels dynamically
- Unable to read JSON in PHP on FTP
- highcharts: when adding new data series add new Y axis only if the title is different from existing Y axis
- highchart - scatter : set decimals of x-axis and y-axis
- Exporting HighCharts chart specific height width
- Highcharts Using CSV instead of JSON
- HighCharts - Bring gridline to front
- Highcharts : use function in Serie data
- Highcharts angular 2 with observables http request
- How to remove white background on a simple bar chart?
- Is highcharts.js capable of formatting integer timestamps into dates?
- Can a Highcharts Polar chart have a logarithmic y-axis?
- javascript highcharts builder function
- Resize data points with highcharts
- How do I change the style of the frame lines in a radar(polar) chart created with highcharts?