I have uploaded a patch that allows the creation of chart entities for axes and titles. While a chart entity is already generated for text titles, it is a simple ChartEntity, and it is not possible to get a reference to the TextTitle for e. g. editing purposes.
No entity is generated for an axis.
The patch includes two new classes AxisEntity and TitleEntity, changes to the axis classes w/o the 3D implementations, and the required change for TextTitle.
The patch makes axes and text titles "clickable" and aims to improve the "interactivity" of the charts.
[patch] special chart entities for axes and text titles
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
I have uploaded a new patch with the following extensions:
- new classes JFreeChartEntity and PlotEntity. These entities are added to the EntityCollection during drawing. They contain clones of the chart area and the data area, respectively, as hot spots, and references to the chart or plot.
- changed LegendTitle: a TitleEntity for LegendTitles is created during drawing using the original title area as hot spot. Most of the hot spot will be overwritten by the hot spots associated with the LegendItemEntities, but clicking on the border of the LegendTitle show give access to the TitleEntity containing the LegendTitle.
- necessary changes of the JFreeChart and Plot, XYPlot and CategoryPlot classes, for example a new protected method createAndAddEntity in the Plot class that is invoked in the draw(...) methods of XYPlot and CategoryPlot.
The goal is to get specific information about what type of object was clicked and get a refence to the object in order to allow for e. g. context-sensitive menus.
- new classes JFreeChartEntity and PlotEntity. These entities are added to the EntityCollection during drawing. They contain clones of the chart area and the data area, respectively, as hot spots, and references to the chart or plot.
- changed LegendTitle: a TitleEntity for LegendTitles is created during drawing using the original title area as hot spot. Most of the hot spot will be overwritten by the hot spots associated with the LegendItemEntities, but clicking on the border of the LegendTitle show give access to the TitleEntity containing the LegendTitle.
- necessary changes of the JFreeChart and Plot, XYPlot and CategoryPlot classes, for example a new protected method createAndAddEntity in the Plot class that is invoked in the draw(...) methods of XYPlot and CategoryPlot.
The goal is to get specific information about what type of object was clicked and get a refence to the object in order to allow for e. g. context-sensitive menus.
This looks like it could be interesting. I was able to add contect sensitive menus to the domain axis, range axis and chart area but I did this by extending the chart info object. This was limiting because you could only have one range axis. I also implemented dragging within the axis to implement zoom in/out.
Having entities for each object should mean you can have multiple range axis and detect in which the mouse is positioned.
I looked at the patch and noticed it was a diff listing. It is ages since I used one of these. Can you tell me what is a good tool to use (on WinXP prefferably) to create a complete file from the diff listing?
Having entities for each object should mean you can have multiple range axis and detect in which the mouse is positioned.
I looked at the patch and noticed it was a diff listing. It is ages since I used one of these. Can you tell me what is a good tool to use (on WinXP prefferably) to create a complete file from the diff listing?
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: [patch] special chart entities for axes and text titles
I have used diffUtils for Windows (http://gnuwin32.sourceforge.net/packages/diffutils.htm).
I have prepared the patches following the advice in this thread:
http://www.jfree.org/phpBB2/viewtopic.p ... 2&start=15
Unfortunately, I have hardly used the patch command line, so I can´t much advice on that. Trial and error will probably more helpful.
I have prepared the patches following the advice in this thread:
http://www.jfree.org/phpBB2/viewtopic.p ... 2&start=15
Unfortunately, I have hardly used the patch command line, so I can´t much advice on that. Trial and error will probably more helpful.
Re: [patch] special chart entities for axes and text titles
Thanks, I'll give it a try this weekend.