JFreeChart 1.0.11

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

JFreeChart 1.0.11

Post by david.gilbert » Fri Sep 19, 2008 11:18 am

A new version of JFreeChart has been posted at SourceForge:

http://sourceforge.net/projects/jfreechart

An updated version of the JFreeChart Developer Guide will be posted early next week.

Some notes about this release:

Code: Select all

JFreeChart 1.0.11
-----------------
19 September 2008

This release features a new chart theming mechanism to allow charts to be
restyled conveniently, a new BarPainter mechanism to enhance the appearance of 
bar charts, a new XYShapeRenderer class, a scaling facility for the 
XYDrawableAnnotation for drawing images within specific data coordinates, some
new classes (XYTaskDataset, XYDataImageAnnotation and XYTitleAnnotation), a 
modification to the Year class to support an extended range, and various bug 
fixes and API improvements.  There is an important bug fix for the 
StackedBarRenderer3D class (see bug 2031407).

This release passes 1,961 JUnit tests (0 failures) on JRE 1.6.0_07.

API Adjustments:
- AbstractRenderer - added clearSeriesPaints() and clearSeriesStrokes() 
    methods;
- BarRenderer - added shadowPaint attribute;
- CategoryAxis - added getCategoryMiddle() method;
- CategoryPlot - added getRendererCount() method;
- ChartFactory - added get/setChartTheme() methods;
- ChartPanel - increased default maximum drawing width and height;
- ChartTheme - new interface;
- ChartUtilities - added applyCurrentTheme() method;
- CompositeTitle - added backgroundPaint attribute;
- GradientBarPainter - new class;
- LegendTitle - added getWrapper() method;
- OHLCSeriesCollection - added xPosition attribute;
- PaintScaleLegend - new subdivisions field;
- PiePlot - added autoPopulate flags, and methods to clear section attributes;
- Plot - added setDrawingSupplier() method;
- RegularTimePeriod - the DEFAULT_TIME_ZONE field has been deprecated in this
    release;
- RelativeDateFormat - added methods to control formatting of hours and 
    minutes - see patch 2033092;
- StandardChartTheme - new class;
- XYItemRendererState - new methods;
- XYPlot - added getRendererCount() method;
- XYShapeRenderer - new class;
- XYTaskDataset - new class.

Patches:
1997549 : Status calls to XYItemRendererState [Ulrich Voigt];
2006826 : CompositeTitle drawing fix;
2033092 : Additional formatters for RelativeDateFormat [Cole Markham];

Bug Fixes:
1994355 : ChartComposite listener type;
2031407 : Incorrect rendering in StackedBarRenderer3D;
2033721 : WaferMapRenderer;
2051168 : No key in LegendItemEntity for pie charts;

Also fixed drawing of alternate grid bands in SymbolAxis, the totalWeight 
calculation in the CombinedXXXPlot classes, a NullPointerException in the
XYPlot class when drawing quadrants, outline visibility in the 
CategoryPlot class, and auto-range calculations with XYBarRenderer.
Last edited by david.gilbert on Mon Jan 05, 2009 8:36 pm, edited 1 time in total.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

mhilpert
Posts: 497
Joined: Wed Apr 02, 2003 1:57 pm
Location: Germany

NEVER CHANGE DEFAULT PLOT SETTINGS!

Post by mhilpert » Tue Sep 30, 2008 10:54 am

I exchnaged 1.0.10 with 1.0.11 and noticed that all my bar charts now show strange colors in their bars and shadows. Perhaps this should "look like" some shiny, roundness, I don't know. The bad thing is, that the release notes doesn't tell about this change of default behaviour! How can I switch this off to the former plain color behaviour?

In addition, my pie charts now have a grey background color (instead of white) ... :-(
Java 11, JFreeChart 1.0.15, JFreeSVG 4.0

RugWarrior
Posts: 17
Joined: Wed Jul 30, 2008 11:54 am

Hint

Post by RugWarrior » Tue Sep 30, 2008 11:36 am


david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: NEVER CHANGE DEFAULT PLOT SETTINGS!

Post by david.gilbert » Thu Oct 02, 2008 9:52 am

mhilpert wrote:I exchnaged 1.0.10 with 1.0.11 and noticed that all my bar charts now show strange colors in their bars and shadows. Perhaps this should "look like" some shiny, roundness, I don't know. The bad thing is, that the release notes doesn't tell about this change of default behaviour! How can I switch this off to the former plain color behaviour?

In addition, my pie charts now have a grey background color (instead of white) ... :-(
I made the decision to change the default look in the 1.0.11 release. I knew it would be inconvenient for some users, but I'm getting positive feedback about the new look, so on balance I think the inconvenience is worth it.

The migration section in the JFreeChart Developer Guide explains how to restore the default "look" - essentially you put the following code somewhere near the start of your application (before you create any charts):

Code: Select all

ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
You'll also need:

Code: Select all

BarRenderer.setDefaultPainter(new StandardBarPainter());
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

mhilpert
Posts: 497
Joined: Wed Apr 02, 2003 1:57 pm
Location: Germany

Re: NEVER CHANGE DEFAULT PLOT SETTINGS!

Post by mhilpert » Fri Oct 24, 2008 11:05 am

david.gilbert wrote:
mhilpert wrote: The migration section in the JFreeChart Developer Guide explains how to restore the default "look" - essentially you put the following code somewhere near the start of your application (before you create any charts):

Code: Select all

ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
You'll also need:

Code: Select all

BarRenderer.setDefaultPainter(new StandardBarPainter());
I did this:

Code: Select all

ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
BarRenderer.setDefaultBarPainter(new StandardBarPainter());
and also had to switch off the bar shadows:

Code: Select all

    /**
     * Enable shadow of renderer?
     * JFreeChart 1.0.11 changed the <b>default</b> look by painting shadows for bars.
     * To revert back to the old look, you can disable the shadows with this method.
     * 
     * @param chart JFreeChart.
     * @param state False, to disable shadow-
     * @since 4.1.0
     */
    static public final void setShadowVisible(final JFreeChart chart, final boolean state) {
        if (chart != null) {
            final Plot p = chart.getPlot();
            if (p instanceof CategoryPlot) {
                final CategoryPlot cp = (CategoryPlot) p;
                final CategoryItemRenderer cir = cp.getRenderer();
                if (cir instanceof BarRenderer) {
                    final BarRenderer br = (BarRenderer) cir;
                    br.setShadowVisible(state);
                }
            }//else: other plot
        }//else: chart unavailable
    }//setShadowVisible()
Java 11, JFreeChart 1.0.15, JFreeSVG 4.0

auism
Posts: 1
Joined: Thu Oct 30, 2008 2:36 pm

Zoom performance

Post by auism » Thu Oct 30, 2008 2:40 pm

Hi David,

I am trying 1.0.11, which looks pretty similar for my current chart implementation, however, I find that zooming using mouse click-and-drag draws a lot slower than 1.0.10, and the pause between mouse release and zooming of chart also seems slower, thoughts?

Kind regards,

Alex
AUISM :)

yuxxfei
Posts: 1
Joined: Mon Nov 17, 2008 10:32 am

the problen of ChartFactory.createXYLineChart(...)

Post by yuxxfei » Mon Nov 17, 2008 10:49 am

First ,i must announce that my English is bad,so please take more minutes to catch my words.

At the release of 1.0.11,when i use the method of CharFactor.createXYLineChart(...),the fourth parameter "XYDataset xydataset",it is a problem.
The type is org.jfree.data.xy.XYDataset or org.jfree.data.XYDataset.
In the demo on your website is org.jfree.data.xy.XYDataset,
but in the jar download from website is org.jfree.data.XYDataset.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Nov 17, 2008 10:52 am

The correct type is org.jfree.data.xy.XYDataset. I think you are mistaken about 'org.jfree.data.XYDataset', it doesn't exist.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

marcinop
Posts: 9
Joined: Wed Nov 12, 2008 1:27 pm

Re: Zoom performance

Post by marcinop » Tue Nov 18, 2008 2:08 pm

Hi
auism wrote:Hi David,

I am trying 1.0.11, which looks pretty similar for my current chart implementation, however, I find that zooming using mouse click-and-drag draws a lot slower than 1.0.10, and the pause between mouse release and zooming of chart also seems slower, thoughts?

Kind regards,

Alex
I agree, 1.0.11 is much more slower. How can I speed it up?

For example:
I have two panels in my application. It is immpossible to do anything when the charts is ON. I use GroupedstackBarRenderer.
Datasets contains about 20 values. So what's going on?

Best
Martin

mhilpert
Posts: 497
Joined: Wed Apr 02, 2003 1:57 pm
Location: Germany

Post by mhilpert » Thu Nov 20, 2008 4:45 pm

ARGH!!! I thought I solved this new behaviour by

ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
BarRenderer.setDefaultBarPainter(new StandardBarPainter());

and switching of shadows, but now I noticed SOME bar charts that look the old way and some bar charts have the new default look!!! I found some places in my code where I create new instances of XYBarRenderer. This is really bad that you changed the default look so that we have to change this new look back to the old look at any instantiation:

Code: Select all

                    XYBarRenderer xybr = new XYBarRenderer();
                    xybr.setBarPainter(new StandardXYBarPainter());
                    xybr.setShadowVisible(false);
:(

SO

Code: Select all

BarRenderer.setDefaultPainter(new StandardBarPainter());
is not enough. There is a

Code: Select all

        XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
but you still have to disable the new shadows at every instance.

Please, never change any default look as it "breaks" old charts! Especially in a chart API, the charts should NOT look different in new versions as there is lots of fine tuning here until we have the charts looking as we want them to.
Java 11, JFreeChart 1.0.15, JFreeSVG 4.0

logicauser1
Posts: 4
Joined: Mon Dec 15, 2008 4:07 pm

Backwards compatibility JFreechart with older versions

Post by logicauser1 » Mon Dec 15, 2008 4:20 pm

Hi David,

I had some questions regarding the backward compatibility of the JFreechart tool. My question is the following. Is the new chart/object 100% compatible with the old charts/object (for example version 2001)?

AK

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Dec 15, 2008 4:44 pm

We try to maintain API compatibility in the 1.0.x series. Version 1.0.0 was released in December 2005. Prior to that, all versions were advertised as "subject to API change".

Within the 1.0.x series, there are one or two incompatible changes that have crept into the code, but almost all code written to the 1.0.0 API will still compile and work with the latest version (1.0.11).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

logicauser1
Posts: 4
Joined: Mon Dec 15, 2008 4:07 pm

Post by logicauser1 » Thu Dec 18, 2008 12:39 pm

Hi David,

I am doing a impact analyses for the JFree chart upgrade from v0.9,6 to the new version. However I want to make an functional overview to compare the functionalities with old and new.

the old object that were used were :
com.jrefinery.chart.ChartUtilities
com.jrefinery.chart.JFreeChart
com.jrefinery.chart.ChartFactory
com.jrefinery.chart.JFreeChart
com.jrefinery.chart.Legend
com.jrefinery.chart.axis.CategoryAxis
com.jrefinery.chart.plot.CategoryPlot
com.jrefinery.chart.renderer.BarRenderer
com.jrefinery.data.CategoryDataset
com.jrefinery.data.DefaultCategoryDataset

Is there any documentation for a functional overview with regards to 0.9.6 version and the new version?

for example:

this is how my sheet looks like:

requirement Old version New Version

graph width ? ?
Left margin ? ?
space first column (bar) ? ?


Please advise

Ali

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Dec 18, 2008 2:00 pm

Please post your questions once only:

http://www.jfree.org/phpBB2/viewtopic.php?t=26685
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

agscontact
Posts: 13
Joined: Mon Dec 01, 2008 4:31 am

Post by agscontact » Sat Dec 20, 2008 7:48 am

Hey Gilbert...what version you released man...its damn slow....i have a table with 833 record...i generated one bar chart using records from this table the same chart takes very less time to get painted in 9 version.....I tried the same in 11...its taking 11 times more time than version 9.....its too bad...Gilbert give some solution....We have already deployed 11 thinking it to be good...do you suggest reverting back to version 9??

Locked