score:1
In my opinion, from a logical perspective, I would use per row the output you have on this moment: dd-mm;data,data,... Is it logical to have the times on the X-axis? This would also mean you can use the append modus.
If you really want to keep the desired output then I would create an array per row something like:
$arr[0][] = '21:00';
$arr[1][] = 'data_b';
$arr[0][] = 'data_b';
$new_data = '';
foreach($arr as $row)
{
$new_data .= implode(',', $row);
}
Note that you cannot use the append modus in this last situation that easily and that this might result in the need to retrieve more data from the database...
score:1
print_r($this->newCsvData) shoud be look like this:
$data = array(
array( '21:00' ),
array( '12' ),
array( '40' ),
);
and in second step, shoud be look like this:
$data = array(
array( '21:00', '21:01' ),
array( '12', '15' ),
array( '40', '40' ),
);
and third step, same:
so who you can do this. Each time you import all data from CSV file and push each cell to the corresponding array and look like this
$newArray = array(array(), array(), array());
foreach($dataFromCSV as $data)
{
array_push($newArray[0][], $data[0]);
array_push($newArray[1][], $data[1]);
array_push($newArray[2][], $data[2]);
}
and then append the new record data in $newArray. delete the old data from CSV file and write on it with new data from $newArray.
:) enjoy
Source: stackoverflow.com
Related Query
- PHP and highcharts: add mysql results as new column in CSV file
- Add a gap between the second and third series in a Highcharts column plot with four series displayed
- how to add new index Highcharts column drilldown chart
- How to delete and add new contents in html file by python
- Add Source to Highcharts Export CSV
- HighCharts - making a Pie with MySQL and PHP
- Add new series to the top of a highcharts stacked column chart
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
- Dynamic column based highcharts feeding data with jquery and php
- How to show an additional column from CSV file as a tooltip in Highcharts
- Add a line on each bar for stacked and grouped column in HighCharts
- Highcharts to display area range and line chart with data from a CSV file
- combine column and splines highcharts using mysql
- Highcharts Select menu from csv file and select option programmatically
- How to display Day and Date in Highcharts Column Graph using PHP
- Only my title shows when using highcharts with php and MySql
- How to filter date in highcharts by using php and mysql
- How to create a column range chart in Highcharts using range and navigator functions?
- Highcharts data series issue with ajax/json and PHP
- Highcharts saying undefined is not a function when trying to add a new chart
- How to update new plotline values instead of removing and adding new ones in highcharts
- How to add image in Highcharts Title and subtitle
- How to add space between chart and axis in highcharts
- Add dynamic data to line chart from mysql database with highcharts
- Change Datalabel Color, Rotation and Align values based on Column value in highcharts
- Creating a line graph with highcharts and data in an external csv
- How to add new points to highcharts after plotting the first 'n' points?
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Exporting highcharts data to CSV file
- Highcharts Stack Column Sum Positive and Negative Together
More Query from same tag
- Problematically highlight(hover) a serie ,highcharts
- Highcharts.js, how to zoom in on one chart to resize another as Stackoverflow has done?
- Can I plot a diagonal plotline in highcharts?
- Highcharts area direction
- Highcharts - column color different from color in legend
- highchart-export-server --batch command running but not converting json into png
- Unable to set the Selected state in Highcharts, when point marker is disabled
- Highcharts: minRange=1 creates -1 and 1 on a chart with one data point
- rangeSelector input and export button missalignment
- Highchart shows text in center on legend mouseover
- Load individual series data as clicked in legend
- Redirecting to a URL on Highcharts marker click
- error while installing highcharts in angular app
- Splitted bar chart for paired data with highcharts
- Install highcharts extenion in yii2 manualy [without composer]
- Highcharts overwrite default DataLabel
- Highcharts: How to group column chart on category
- Additive Color in Highcharts
- Highcharts through ajax not drawing
- not able to get refs on addEventListener callback function
- Bar value depend on other bar value in HighChart
- Highcharts area: x-axis in hours but showing multiple points in each hour
- Dynamically update highchart series in meteor
- Highcharts: multiple yAxes labels overlap
- How can I fix the navigator issue in highstock when I have more than 1 series in different time intervals?
- Highcarts - Have datetime xaxis start on certain month
- highcharts how to hide legendSymbol in front of particular legend name?
- Pass Json Object from Play! framework to HighCharts JS
- Center Highstock chart scrollbar handle
- Big data amounts with Highcharts / Highstock (async loading)