0

I would like to generate a pretty graph to show it at meetings; since most of the time, we have people that are not necessarily able to get the picture just looking at numbers.

I did create a simple website where to post these results, and I am saving the output from my tool, as CSV. Posting it on a web page is easy, since the output is read directly from the web server, and it display it as text.

But I would like to make a graph, and so far I did find solutions that require to create a web app; which is not necessarily something that I would like to pursue at this time (not much time available).

Is there an easy way to generate graphs from CSV files, and post it in a way that a simple apache server can read it and display it? I was thinking to use excel, since there are tools for Python that allow worksheet to be read, so I assume there is a way to do the opposite (create worksheet from data and make a graph). In the worst case, I was planning to make PNG of the graphs and post them as images; although it does not feel like something that is sustainable.

  • has anyone here used [`bokeh`](http://bokeh.pydata.org/en/latest/) in anything practical? it looks great, but I don't do web dev, so I have no idea how easy it is to implement – Aaron May 08 '17 at 18:13
  • This bokeh seems pretty interesting; you write python code and it output a html page, which is easy to put in a frame on another web page; worth exploring it. –  May 08 '17 at 20:01

3 Answers3

0

You can used Google Charts to publish (and layout) you data as a pretty graph. There is a big collection of charts.

To layout your data from a CSV file, you can use jquery-csv library to load your data from a CSV string. See this question os SO: How to use Google Chart with data from a csv

Community
  • 1
  • 1
Laurent LAPORTE
  • 21,958
  • 6
  • 58
  • 103
  • If I can run Google Charts in local without send out data, then it may work. The syntax seems pretty easy, even if I do not know much of JS. Thanks! –  May 08 '17 at 18:19
  • 1
    What do you mean by "send out data"? Your data is not sent to Google, if it is what you mean. The Google Charts API is loaded on the client browser, which also load you CSV data. You don't need to develop a big web app: only a static web page with JavaScript. – Laurent LAPORTE May 08 '17 at 18:25
  • I see; since our intranet server is not going on internet, I was wondering if that would work. I can get these libraries included in the header of the webpage, so they will work in local, if no connection with Google is necessary. Sorry but I never had to solve such probems, so I am learning as I go :) –  May 08 '17 at 20:00
0

you can use matplotlib to create the graphs in python. You can also use Plotly to do the same. The graph created would be an image file though.

This means you will have to write something extra for what you want to do with the webserver.

If you want to make them visually more appealing then try this link: make beautiful graphs

ghost_duke
  • 121
  • 7
  • I do use already matplotlib; I do save the output as PNG to post it on the web page, but it is not really scalable. Plotly require an internet connection, I believe it is working only if you have a connection to the outside, while our server is intranet. It does look pretty, I wish it was possible to run it locally –  May 08 '17 at 18:15
  • 1
    you can do similar things with [bokeh](http://bokeh.pydata.org/en/latest/) and it's free to run locally – Aaron May 08 '17 at 18:16
0

I have just released a wrapper library pyexcel-pygal, with which you can plot csv in svg format easily. I believe you will be interested in these examples.

chfw
  • 4,502
  • 2
  • 29
  • 32