#119 NoDataMessage is not displayed...

open
David Gilbert
General (896)
7
2003-03-04
2003-02-23
Klaus Rheinwald
No

...although it was set and datasets are set to null:

jumpPlot.setDataset(null);
jumpPlot.setSecondaryDataset(null);
jumpPlot.setNoDataMessage("No Data");

See attached image.

Discussion

  • Logged In: YES
    user_id=655295

    Attached modified XYPlot.java to properly display
    noDataMessage and Plot.java to support
    noDataMessagePaint nad secondaryNoDataMessage.

     
    • priority: 5 --> 7
     
  •  
    Attachments
  • David Gilbert
    David Gilbert
    2003-03-04

    • labels: --> General
     
  • David Gilbert
    David Gilbert
    2003-03-04

    • assigned_to: nobody --> mungady
     
  • David Gilbert
    David Gilbert
    2003-03-04

    Logged In: YES
    user_id=112975

    Hi Klaus,

    I've incorporated the 'no data' message changes for the
    primary dataset, with a small change. I've created a new
    isEmpty(...) method in the DatasetUtilities class to check
    whether or not the dataset has any data. Your code checks
    that:

    - the dataset is not null;
    - there is at least one series;
    - there is at least one item in the first series;

    This could fail where there are two or more series, but the first
    contains no items.

    I'm also still wondering about having a message for the
    secondary dataset. How do you make sure it doesn't overlap
    the message for the primary dataset when neither has data?

    Regards,

    Dave Gilbert

     
  • Logged In: YES
    user_id=655295

    David,

    good point regarding isEmpty(). I'm only displaying one series... Regarding the message for the secondary dataset:
    What about shifting the primary message up and the secondary message down by fontheight()?

    I'm only using the primary message, so this was added just for completness as I started digging through the code
    to fix the no data message not being displayed.

    Klaus

     
  • Logged In: YES
    user_id=655295

    Ok, shifting the secondary data message down a little bit did
    the trick. Just change

    - (bounds.getHeight() / 2)

    to

    + bounds.getHeight()

    in drawSecondaryNoDataMessage(...). Secondary message
    is the displayed slightly below the middle.

    Complete line is:

    float y = (float) (area.getMinY() + (area.getHeight() /
    2) + bounds.getHeight());

    HTH,
    Klaus