Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#970 DefaultPolarItemRenderer and null-values

open
nobody
None
5
2012-11-27
2009-11-19
Martin Höller
No

The only PolarItemRenderer that currently comes with JFreeChart 1.0.13 is DefaultPolarItemRenderer. You can configure it to connect the items and draw a polygon. If some items within a series have null values for X or Y, the renderer produces strange/undefined behavior, i.e. the corresponding point is located at the top-left corner of the plot (see attached screenshot, the blue series).

The problem is, what would the correct behavior be? Linecharts usually skip null-items, leading to a gap in a line. But that's problematic in combination with the fillSeries-feature of this renderer. How can we fill an open polygon? Should filling be disabled automatically if null-items are contained in a series?

The problem is located in DefaultPolarItemRenderer.drawSeries() while building the polygon. Around line 290.

Discussion

  • Martin Höller
    Martin Höller
    2009-11-19

    polarchart with null-values

     
    Attachments
  • Martin Höller
    Martin Höller
    2010-06-28

    IMHO there are (at least) two possible solutions to this problem:
    a) define, that datasets used with the DefaultPolarItemRenderer must not contain null-values or
    b) make the renderer aware of handling null-values in some way

    I prefer (b). Possibilities for representing null-values could be to just skip/ignore them, or to convert them to zero. The latter would probably make sense only for null y-values.