Menu

#986 Invalid bounds of range axis in CombinedDomainXYPlot

1.0.x
closed-fixed
1.0.x (2)
5
2014-09-02
2010-02-24
No

Bounds of subplot range axis in CombinedDomainXYPlot are invalid after dataset changes.

Step to reproduce:
1) run attached demo
-range and domain axis changes to default [0,1] range.
2)click to "add data" button
-domain axis has correct range, but range axis still has [0,1] range.
-neither "Auto range"->"Both axis" nor "Auto range"->"Range axis" context menu items not give any effect.

Workaround: invoke configureDomainAxes method on CombinedDomainXYPlot earlier than configureRangeAxes on subplot.

Discussion

  • Vladimir Shirokov

    Example of invalid range bounds on subplot of CombinedDomainXYPlot

     
  • simon04

    simon04 - 2014-08-26

    Patch attached.

     
  • Vladimir Shirokov

    This patch fixes "Auto range" context menu behaviour, but the bug is still actual. Domain axis has correct range[-10,10], but range axis still has [0,1] range after adding data.

     
  • David Gilbert

    David Gilbert - 2014-08-28

    This looks like it fixes it. It is not a very "clean" fix, since the XYPlot class shouldn't really need to know anything about the combined XYPlot classes, but I can't think of another way to do it yet:

    Index: XYPlot.java
    --- XYPlot.java Base (BASE)
    +++ XYPlot.java Locally Modified (Based On LOCAL)
    @@ -4536,12 +4537,15 @@
    */
    @Override
    public void datasetChanged(DatasetChangeEvent event) {

    • if (getParent() instanceof CombinedDomainXYPlot) {
    • getParent().datasetChanged(event);
    • }
      configureDomainAxes();
    • configureRangeAxes();
    • if (getParent() != null) {
    • if (getParent() instanceof CombinedRangeXYPlot) {
      getParent().datasetChanged(event);
      }
    • else {
    • configureRangeAxes();
    • if (getParent() == null) {
      PlotChangeEvent e = new PlotChangeEvent(this);
      e.setType(ChartChangeEventType.DATASET_UPDATED);
      notifyListeners(e);
     
  • Vladimir Shirokov

    Yes, the above fix fixes bug. But what about changes in CombinedDomainXYPlot instead of XYPlot?-) Please look at the attached patch.

     
  • David Gilbert

    David Gilbert - 2014-08-31

    Thanks Vladimir, I like your fix better. I have committed it for inclusion in the next release (1.0.20).

     
  • David Gilbert

    David Gilbert - 2014-08-31
    • labels: --> 1.0.x
    • status: open --> closed-fixed
    • assigned_to: David Gilbert
    • Group: --> 1.0.x
     
  • Vladimir Shirokov

    Looks like this fix also fixes bug-1101

     

Log in to post a comment.

Auth0 Logo