1

I'm new to web pages and dynamic content:

I have a server running php and I'm able to read in and display CSV text data - how may I graph this? I was using http://phpmygraph.abisvmm.nl/ but I'm unsure how to parse my CSV data into columns.

In addition, how do I create date-time objects in PHP (is this possible?)

A code example:

    <?php
//Set content-type header
header("Content-type: image/png");

//Include phpMyGraph5.0.php
include_once('phpMyGraph5.0.php');

//Set config directives
$cfg['title'] = 'Flow data site#3, John Radcliff Hospital';
$cfg['width']  = 500;
$cfg['height'] = 250;

//Set data
$data = array(
    'Jan' => 12,
    'Feb' => 25,
    'Mar' => 0,
    'Apr' => 7,
    'May' => 80,
    'Jun' => 67,
    'Jul' => 45,
    'Aug' => 66,
    'Sep' => 23,
    'Oct' => 23,
    'Nov' => 78,
    'Dec' => 23
);

//Create phpMyGraph instance
$graph = new phpMyGraph();

//Parse
$graph->parseVerticalLineGraph($data, $cfg); 
    ?>

This image shows an example of data I can generate on a webpage and the graph I would like to see - this is not a screen shot, only a 'wish list' of what I would like to generate:

enter image description here

1 Answer 1

1

if I can recommend, I would adapt your data and would use Google Charts

https://developers.google.com/chart/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.