1

I need to show a graph(piegraph and XYgraph) in HTML file. I have used some free tool created an image and I am trying to show this on HTML.

But, we need to place this image in shared folder or in a server to get accessed by HTML.Our client is not satisfied with both approaches.

Can some please let me know whether there is any way where I can pass data directly to html file. The data will be in csv file and it may contain some thousands of rows.

Thanks,

Praveen
  • 53
  • 1
  • 1
  • 8
  • 1
    How does this not have the same problem--any HTML file will have to be accessed somehow, by email, shared drive, web server, or *something*. – ErikE Aug 01 '12 at 06:39

2 Answers2

3

There is a Javascript framework that renders really pretty charts: http://www.highcharts.com/

You can use one of many CSV Javascript parsers: Javascript code to parse CSV data

If you then write some javascript code to extract your CSV data, and pass it to highcharts, you've got a very nice interactive chart.

The alternative, if you want to use your existing images, is to encode the images as base64 directly in the html file: http://webcodertools.com/imagetobase64converter/

Community
  • 1
  • 1
Wouter Lievens
  • 4,019
  • 5
  • 41
  • 66
  • using javascript again has dependency with javascript file. Our client don't want any dependency. We need to place all the data in csv file in HTML itself and show this in graphical format. – Praveen Aug 02 '12 at 08:13
  • Well, you could write a really simple chart generator in javascript and put that javascript code in the HTML file itself. But to be honest I don't understand the problem. – Wouter Lievens Aug 02 '12 at 11:35
  • Thanks for your help.First of all I want let you know that I am a automation engineer for testing. We have created a framework which runs the automated test cases and sends report in HTML format.Our client is not satisfied with tabular format he want everything in graphical format. we have one scenario where we will be having test data in excel and we need show this in graphical format in html without any dependencies. Hope you understood what I am trying to do now – Praveen Aug 03 '12 at 05:42
  • And also, I tried highcharts they seems to work for me, I am trying with area graphs, but the issue I am facing is I need to show "timestamp" in x-axis but it seems they support only integers. If possible let me know how I can insert timestamps – Praveen Aug 03 '12 at 05:45
  • Sorry, I don't know that much about highcharts. Create a separate question on SO, or on their help fora. – Wouter Lievens Aug 03 '12 at 08:23
  • Also, if highcharts has a minified javascript version, you can just copypaste its contents into your html template. – Wouter Lievens Aug 03 '12 at 08:24
  • Thanks Lievens, I have used highcharts successfully – Praveen Oct 10 '12 at 05:43
1

As an alternative you can also look at the Dojo Toolkit (http://dojotoolkit.org/), its a Javascript toolkit with some really nice features including charting.

Rainer.R
  • 458
  • 2
  • 8