Re: ImportFromCSV Deprecated?
> ImportFromCSV Deprecated?
Yeeess... ? Maybe, importFromCSV() will be realised in next releases... Anyway, I'm using this code:
Code:
// Получение данных из файла
$dataHits = Array();
$dataUniq = Array();
$dataDate = Array();
$file = fopen('data.csv', 'r');
while(!feof($file)) {
$buffer = fgets($file, 4096);
if(strlen($buffer) == 0)
break;
list($date, $dataUniq[], $dataHits[], $foo) = explode(',', $buffer);
unset($foo);
$date = explode('.', $date);
$dataDate[] = $date[0] . $date[1];
unset($date);
}
fclose($file);
unset($file);
unset($months);
// [pData] Загрузка данных
$data = new pData();
$data->addPoints($dataHits, 'Hits');
unset($dataHits);
$data->addPoints($dataUniq, 'Uniq');
unset($dataUniq);
$data->addPoints($dataDate, 'Date');
unset($dataDate);
With this CSV:
http://samisusami.net/engine/data/counterData.csvResult is in my signature. Click on image to see the full chart.