unable to upload the html file made from gnuplot canvas

Help
hpdp
2013-07-22
2013-07-23
  • hpdp
    hpdp
    2013-07-22

    I made a html file using gnuplot canvas:

    gnuplot> set terminal canvas
    Terminal type set to 'canvas' Options are ' solid butt size 600,400 fsize 10 lw 1 fontscale 1
    standalone'
    gnuplot> set output 'output.html'
    gnuplot> plot [0:25] sin(x)

    But when I opened the output.html at browser, it didn't display anything, just blank page. I looked the content of output.html, it seems ok.

    Thanks for any help!!

     
  • Ethan Merritt
    Ethan Merritt
    2013-07-22

    The top of your output file should look like this:

    <title>Gnuplot Canvas Graph</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
    <script src="/usr/local/share/gnuplot/4.6/js/canvasmath.js"></script>
    <script src="/usr/local/share/gnuplot/4.6/js/gnuplot_common.js"></script>
    

    Notice that it instructs the browser to load javascript from (in my case) the directory /usr/local/share/gnuplot/4.6/js/. This default location is determined at the time gnuplot was built. It might be different on your system.

    Anyhow, the most likely cause of a blank screen in the browser is that the javascript files are not found in that directory. You can either put them there, or specify a different place to look for them. For example

    set term canvas jsdir "http://gnuplot.sourceforge.net/demo_canvas"

     
  • hpdp
    hpdp
    2013-07-23

    Thank you, Ethan!! It works now! I copied the js files to my local dir, then
    set term canvas jsdir "my local dir"

    Now I have graph.html which displays a simple graph at browser. My next step is
    to make the datapoint(notes) clickable. When I click a datapoint, it should take
    the x,y value and call a cgi to display a result at another page.
    Can this be done?
    I searched the web, but can't find a good site about it.
    Any information are greatly appreciated!!!
    Thanks!!!!

     
  • Ethan Merritt
    Ethan Merritt
    2013-07-23

    There was a recent discussion about this, but I can't seem to find it [too many mailing lists, wikis, trackers, ...]

    Anyhow - the closest we have right now is the hypertext option. You can associate a URL with each point if you like but it will pop up a box showing the URL itself as hypertext rather than triggering it as a hyperlink.

    I would like to see discussion as to whether it would be a good idea to provide a clickable link, and if so, how to do this for wxt/windows/cairo. I already know how to do it for the canvas and svg terminals, but if we do this at all it would better to support as many terminal types as possible.