Displaying graph in project page

75 views
Skip to first unread message

Bruno

unread,
Feb 27, 2015, 4:52:09 AM2/27/15
to jenkin...@googlegroups.com
Hi everyone,

I'm trying to display a graph in the project page. I'm using the Disk Usage Plugin to understand how to do so, but there are some points that are not clear to me.

Basically, I have a ProjectAction class with a getGraph() method, returning a Graph object. In the "resources/..../ProjectAction" folder, I've written a floatingBox.jelly where I've put :

<img src="${it.getUrlName()}/graph/png?height=200&amp;width=550" lazymap="${it.getUrlName()}/graph/map"/>

like in the disk usage plugin.
But it doesn't seem to work. It just displays a tiny empty image. 

To figure out what's going on, I would like to know what are these paths (/graph/png, /graph/map) ? What are they related to ? How does it work ?

Thx in advance,

Bruno


Ioannis Moutsatsos

unread,
Feb 27, 2015, 10:24:46 AM2/27/15
to jenkin...@googlegroups.com
Is this graph specific to each build?  Or is it specific to the project?

I have used some simpler ways for putting graphics on Jenkins project and build pages

If the URL for getting  this graph is well understood (like always pointing to the last successful build) and you wanted to show it in the Project page you can add it to the description of the project with some standard HTML. (for this to work you need to set the 'Raw HTML' as the Markup Formatter (on the Jenkins Configure Global Security page )

If the graph is specific to the build, then you can add it to a build-specific report using one of the available plugins like the Summary Report [1] or the HTML Publisher [2] plugins.

Jesse Glick

unread,
Feb 28, 2015, 5:26:26 PM2/28/15
to Jenkins Dev

On Feb 27, 2015 4:52 AM, "Bruno" <bruno....@liebherr.com> wrote:
> To figure out what's going on, I would like to know what are these paths (/graph/png, /graph/map) ? What are they related to ? How does it work?

You need to read the Stapler reference.

Bruno

unread,
Mar 2, 2015, 2:54:56 AM3/2/15
to jenkin...@googlegroups.com
It's more like a trend graph, so the graph is built every time a build is successful. And the image of the graph (like the .png file) isn't created on the disk, it's all done in the java code.

I'm going to read the stapler reference and I'll be back if it's still not clear.

Thx

Jesse Glick

unread,
Mar 2, 2015, 5:34:20 PM3/2/15
to Jenkins Dev
On Mon, Mar 2, 2015 at 2:54 AM, Bruno <bruno....@liebherr.com> wrote:
> the image of the graph (like the .png file) isn't created on
> the disk, it's all done in the java code.

See for example MultiStageTimeSeries.TrendChart, which is returned
from some Stapler web methods since it implements HttpResponse.
Reply all
Reply to author
Forward
0 new messages