The <img> tag's src needs to be a URL, not a filename on the server. So it depends on what your webserver is configured to use as the document root - i.e. which directory on the server files are served from when the user visits http://www.example.com/. If the document root is for example /var/www, then you could maybe use <img src="/grafika/graphHour.png" ... (although depending on how your site is set up, relative URLs might be better).
By the way, it'd be better if you didn't generate HTML like this. I recommend you look into e.g. HTML::Tiny, Template::Toolkit, or maybe even a web framework, such as Mojolicious.