score:9
So I found a solution.
After getting the data, I did
$.each(item, function (index, value) {
objects.push([value.name, value.value]);
});
And then bound my series with
series: [{
data: objects,
name: 'Value Type Description'
}]
So I have "Value Type Description" in the legend, but when I hover over a specific point I have the name as the label, and valid data displaying in graph form.
I found at http://api.highcharts.com/highcharts#series that if you have an array of two dimensional arrays, you can just pass a string as the first parameter and it would parse it as the label for that point.
EDIT: Example per request.
So you have two pieces to the series
field, data
and name
. Name
does NOT apply to the data
, that will be the name of the axis.
So data
is an array of key/value pairs.
data: [
{[key1, value1]},
{[key2, value2]},
{[key3, value3]}
]
And name
is what the "main" label will be - "My Data Stuff" for example.
Then, when you load the chart, in the legend it should say "My Data Stuff", but when you hover over a specific point, say the first one, it will display the Key1 Value1 information.
score:7
data: [{
name: 'Point 1',
y: 1,
test1:9,
test2:'ddaf'
}, { -------> right
name: 'Point 2',
y: 5,
test1:12,
test2:'ddddaf'
}]
data: [{
my_name: 'Point 1',
y: 1,
test1:9,
test2:'ddaf'
}, { -------> we change 'name' to 'my_name',
my_name: 'Point 2', then the name you want to show become
y: 5, 'Slice', instead of 'Point 1','Point 2'
test1:12,
test2:'ddddaf'
}]
data: [{
my_name: 'Point 1',
my_y: 1,
test1:9,
test2:'ddaf'
}, { -------> Now,we get nothing.
my_name: 'Point 2',
my_y: 5,
test1:12,
test2:'ddddaf'
}]
So,the 'name' and 'y' is the key.
Source: stackoverflow.com
Related Query
- Use an array of objects for series data in Highcharts
- Add additional data to a Highcharts series for use in formatters
- 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 overriding X or Y axis key for series data objects
- Use Node.js as data source for highcharts
- Changing data dynamically for a series in Highcharts
- Highcharts series data array
- Highcharts how to use JavaScript variable as series data source?
- Highcharts - Provide URL's for series data to open clickable link
- Sort the series data for every X-Axis in Highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts not displaying series data for graph with multiple Y-axes
- Restructuring array for Highcharts use
- how to use object as series for Highcharts
- How to use for loop array to add series dynamically for line chart
- Extracting data from a JSON call to a Postgres table for use in Highcharts (without PHP)
- Formatting data array correctly for Highcharts
- Use array data in highcharts
- Highcharts series showing different data for 'column' and 'line' chart
- Highcharts series data array not working
- Show Data For Grouped Series in ToolTip Highcharts
- Highcharts display label for pie chart using html table as data source
- Highcharts Tooltip - Access "z" value in series data array
- HighCharts - Enable the markers for the series which has only single data point?
- Highcharts Polar Chart - Specify Data Series & Tooltips for each Axis
- Form data series for highcharts columns
- Highcharts series visibility with csv data source
- HTML table as data source for highstock charts using highcharts
- Need to generate random data for Highcharts series
More Query from same tag
- How to get proper stack labels with 'datetime' axis?
- Highcharts with DHTMLX menu appearance
- HighCharts losing all data when addPoint is called
- Referencing array values within nested objects/arrays
- Add custom images in highstock series
- adding increase arrow in highcharts
- I have correct XPath but selenium is not clicking in Highcharts popup
- Call a function from within highchart click event in reactjs
- Highcharts, get point index when shared tooltip is shows/hides
- Highcharts 3D Pie
- Highcharts - heatmap : avoid 0 on resize chart
- Highcharts don't hide categories labels on overflow
- how can we draw column chart with stacked column chart in a single high chart?
- Websharper HighCharts Example
- center rendered label in High Charts
- Changing data in HighCharts series causes y-axis to blow up
- gantt chart plot wrong date on xAxis
- Funneling a user input back through and model to render again
- Adding Multiple HighCharts on one screen Angularjs
- Making a master-detail Highchart in Stackoverflow style
- Update Sankey chart via Socket.IO
- How to change the point color to red that is lowest point plotted in the graph and 2nd issue is animation effect is not supporting in the ie10,ie8
- Highcharts area chart with lazy_chart ruby gem
- Django query database and send data to template
- Word Cloud from Highcharts - Create a placement strategy so words are ordered from highest weight to lowest
- how to change the position of HighCharts.js scatterplot marker position
- Getting error when using angular2-highcharts in angular2 project
- How do I set the margin to bottom of a chart in HighCharts to zero?
- Why I cant put the highcharts.chart in render?
- Highcharts -Highmaps making map curved(geojson QGIS)