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
- HighCharts does not recognize a function of Legend
- Highcharts table style in tooltips not working
- Highchart | Grouped stacked bar chart | Multiple stack labels
- Labels position of xAxis in Highcharts
- How to remove "Values" and "series" from highcharts?
- loading highcharts with data from database
- Highcharts data loading from a JSON file error in setting up datetime
- Highcharts - Change line color between points
- How to spread Y Axis values in "area" chart using HighCharts
- Highchart Pie Chart shows "slice 0.0%" when loading data from csv
- Two tool tip for two different charts
- Can I lay two Highcharts series side-by-side?
- How to get rid of highcharts 13 error in angular?
- Highcharts in Laravel 4 project are not displayed
- add custom links to series / data sections in pie chart (highcharts.js)
- How to set Highchart datetime format to minute?
- Highcharts - After setting minTickInterval to one day, tickmarks aren't appearing under points
- high chart date format in x-axis
- How to access methods of wrapper Highcharts vue?
- How to use Vue bound data in Highcharts?
- Highchart - Min max and Mean chart
- Highcharts series graph to start and end on tick and end on max
- Setup of Highcharts and PhantomJS on Windows 7. JSON string parse error
- How can I restore original point symbols to highcharts?
- How to change time frame of the candle stick chart in Highcharts (Highstock)?
- rangeSelector: change date beyond zoomed time range
- Highcharts - Tree map rectangles are showing the next level
- R highcharter plot points color based on value
- How to add dotted lines between two interval of x-axis in hightcharts
- make highchart stacked column chart count zero value