Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 371290

Summary: Use SWTChart API for charting
Product: [Tools] Linux Tools Reporter: Roland Grunberg <rgrunber>
Component: ProjectAssignee: Roland Grunberg <rgrunber>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: anithra, jerome.correnoz, lilia.ghachem, obusatto, overholt, wainersm, xraynaud
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 373552    
Bug Blocks:    

Description Roland Grunberg CLA 2012-02-10 16:01:30 EST
It seems that o.e.l.{systemtap.ui.graphingapi.ui,dataviewers.charts} all use BIRT for charting. With the recent work that has switched Valgrind Massif over to using SWTChart (branch feature/valgrind/no-birt), I think we can definitely do the same for these other plugins. I'm more than willing to do this work.
Comment 1 Andrew Overholt CLA 2012-02-16 13:35:00 EST
Adding interested parties to CC.
Comment 2 Wainer dos Santos Moschetta CLA 2012-02-29 09:50:05 EST
Some information I have already sent to the mailing list
-------------

Systemtap and massif uses BIRT API directly. Gprof and gcov relies on org.eclipse.linuxtools.dataviewers.charts, that in turn uses BIRT API.

BIRT charts being used:

* Systemtap (some charts are not working)
  Area Chart
  Bar Graph
  Line Graph
  Meter Chart
  Pie Chart
  Scatter Graph
* Massif
  exports chart as svg
  scatter chart
* gprof and gcov
  bar graph (horizontal and vertical)
  pie chart (3d)
  export chart as jpeg
Comment 3 Roland Grunberg CLA 2012-03-01 10:45:25 EST
As an update, the work has been done for Massif (feature/valgrind/no-birt) is now merged into master.

As for gprof/gcov, the only functionality that will not be possible is the pie chart. SWTChart currently has no API for generating pie charts, but perhaps this could be proposed in the future.
Comment 4 Roland Grunberg CLA 2012-03-01 16:26:18 EST
I've started having the dataviewers plugin hook into org.swtchart for charting. I can see that the dataviewers also had some functionality to import/export a chart as XML. It goes without saying that SWTChart doesn't have this capability, but the .gmon output file can always serve as a way of storing the chart data in a "lossless" sense.
Comment 5 Wainer dos Santos Moschetta CLA 2012-03-02 13:12:16 EST
(In reply to comment #3)
> As an update, the work has been done for Massif (feature/valgrind/no-birt) is
> now merged into master.

Great! I will try to test it right away.

> 
> As for gprof/gcov, the only functionality that will not be possible is the pie
> chart. SWTChart currently has no API for generating pie charts, but perhaps
> this could be proposed in the future.

so for now gprof/gcov will still be birt-dependent? or do you plan to work on the SWTChart as well?
Comment 6 Roland Grunberg CLA 2012-03-07 15:17:35 EST
In this case it'd be an all or nothing switch. The exporting/importing XML was probably designed to work with the BIRT charting framework, so I don't think we'd be able to use that functionality at all if we switched to SWTChart. The importing chart XML is currently disabled.
Comment 7 Otavio Pontes CLA 2012-03-07 15:22:06 EST
(In reply to comment #6)
> In this case it'd be an all or nothing switch. The exporting/importing XML was
> probably designed to work with the BIRT charting framework, so I don't think
> we'd be able to use that functionality at all if we switched to SWTChart. The
> importing chart XML is currently disabled.

Does anyone use that? As you said it is possible to recreate the chart every time you need using the .gmon file. Saving the xml only makes sense to me if someone is parsing that in any external project. But I don't think it is the case.
Comment 8 Otavio Pontes CLA 2012-03-07 15:23:59 EST
(In reply to comment #7)
> (In reply to comment #6)
> > In this case it'd be an all or nothing switch. The exporting/importing XML was
> > probably designed to work with the BIRT charting framework, so I don't think
> > we'd be able to use that functionality at all if we switched to SWTChart. The
> > importing chart XML is currently disabled.
> 
> Does anyone use that? As you said it is possible to recreate the chart every
> time you need using the .gmon file. Saving the xml only makes sense to me if
> someone is parsing that in any external project. But I don't think it is the
> case.

Does SwtChart support export as an image file? That is a feature really useful that I'll miss.
Comment 9 Roland Grunberg CLA 2012-03-07 15:31:11 EST
Agreed (comment 7). Though given that we'd be removing functionality I don't mind hearing other people's points of view on this. SWTChart doesn't export as an image file from what I can see but there is support in SWT for this. Basically converting a Composite to an image. In Massif I exported the chart as a PNG (ChartPNG.java:35 , renderPNG()).
Comment 10 Andrew Overholt CLA 2012-03-07 15:59:02 EST
CC'ing Lilia from ST to be sure she's aware (althought perhaps Jerome is already aware enough for ST :) ).
Comment 11 Roland Grunberg CLA 2012-03-14 17:01:33 EDT
I've set up a remote branch (feature/dataviewers/no-birt) to track progress. I've implemented bar chart rendering, and saving as an image file. This should be most of the work.
Comment 12 Roland Grunberg CLA 2012-05-08 17:20:24 EDT
feature/dataviewers/no-birt has been merged into master. See 99cfe57c1eb03e84062b1b15c8606f4425c7f9df. Resolving as fixed.