score:2
Accepted answer
You'd first have to build the non-db-related parts into your PHP structure, e.g.
$data = array(
0 => array(
'name' => 'Female',
'marker' => array (
'symbol': 'circle'
etc....),
'data' => array() // database insertion occurs here
),
1 => array(
'name' => 'Male',
etc...
)
);
$locations = array('Female' => 0, 'Male' => 1, etc...) // reverse map your 'name' fields
while(...) {
$data[$locations[$row['name']]][data]['x'][] = $row['price'];
$data[$locations[$row['name']]][data]['y'][] = $row['quantity'];
^^^^^^^^^^^^^^^^^^^^^^^^--- reverse lookup to get right array index for 'name'
}
score:0
First I'm going to recommend you take a look at your SQL query, especially the part of WHERE id=$1
. If I'm not mistaken (and on this I'm fairly sure.) your query is going to return one (1) row not many like what you probably want. I would recommend removing the WHERE
clause and see if that solves your problem.
If not drop me a line and I'll see what else I see and we can go from there.
Source: stackoverflow.com
Related Query
- Process SQL to JSON through PHP for Bubble Chart
- JSON data not showing in highstock candlestick chart using PHP and SQL
- mySQL with PHP to JSON for clientside chart
- How to format PHP into the proper string for JSON in pie chart using highchart
- Displaying additional text for Highcharts Bubble chart
- Importing JSON file into Highcharts for Bar Chart Visualization
- Write JSON parser to format data for pie chart (HighCharts)
- How to format my json data for stack column chart in HighCharts
- JSON data not showing in highstock Candlestick chart using PHP & MYSQL
- white border/line color set on hover for the bubbles in the bubble chart not being reset on mouse out from bubble
- Highcharts display label for pie chart using html table as data source
- Simple, Open source PHP wrapper for Highcharts library
- Create Pie chart for each Json object
- Converting a complex json format to C# class for Highchart Organization Chart
- Convert group json for Highcharts Donut chart
- Highcharts chart dynamic json data from sql
- Extract data series from a JSON array for a Highcharts chart with 2 y-axis
- Gson to get Json value for a pie chart using Highcharts
- Generating json data for StockChart from PHP
- Highcharts to populate data for pie chart using json object
- highchart bubble chart dynamic- json format
- Highchart Json Format for Highchart stock chart
- Set Color for Pie Chart using HighChart + JSON data
- Data Conversion from SQL, C# with Linq to JSON for Highcharts Line chart
- Manipulate PHP array to group small values for use in Pie Chart
- How can I get proper object through loop using javascript for Bubble Charts of Highcharts
- JSON string from SQL Table - Bad values in the chart
- dynamically generating json from json for highcharts heap map chart using ajax
- HighCharts Bubble graph JSON as data source
- giving a local json file for line chart
More Query from same tag
- How to redraw text rendered using SVGRenderer in Highcharts React?
- Json is syntax-valid, but the HighChart won't display series correctly
- Highcharts SVG difference with Node JS SVG
- How to update drilldown data in highchart without redraw the chart?
- Highcharts Highmaps the data does not match with polygons correctly
- Update specific slice of pie chart
- Angular : SetData to HighChart widget from an array object
- live chart for heartbeats
- Highcharts gauge not showing colour as expected
- Activity Gauze Highchart DataLabel
- Llive data dynamic update on Highstock chart ( Cannot read property 'info' of undefined) error?
- Is there a way to limit legends on a horizontal layout on specific amount of rows during export?
- Highcharts stacked bar chart Likert scale centering
- Highcharts bargraph from json data in angularJS
- Unable to add point into highchart area
- Highcharts Gauge styling and adding CSS elements
- Highcharts sparklines from ajax-inserted data
- Highcharts map chart not drawing bubble on calling setData
- Highchart.js X-axis labels - values are NaN
- I have enabled scrollbar in high chart.. But its not working
- how to get svg of highcharts using div id?
- Highcharts custom pattern fill shows different stroke width
- How can I open a high chart in a modal window when the chart is clicked on?
- How to make the legend come in the image in highcharts?
- Highcharts not working after jquery upgrade
- Highcharts: Giving Series Update Animation Same Smoothness as Point Update Animation
- How to remove margin from gauge chart in Highcharts?
- sorting categories in a highcharter stacked column chart
- Highchart from json object
- How to use react-highcharts to plot bell curve