Menu

#62 LineGraph with Band Demo

closed
nobody
5
2012-09-19
2007-07-13
No

I noticed the following behavior:

When you zoom in into the LineGraph with Band Demo (V5.0.9) the Band exceeds the borders to the left and right, the background color of the graph doesn't.

Is this the intended behavior?

TIA, dbuecherl

Discussion

  • Dieter Buecherl

    Dieter Buecherl - 2007-07-13

    Logged In: YES
    user_id=1842985
    Originator: YES

    File Added: LineBand.jpg

     
  • Dieter Buecherl

    Dieter Buecherl - 2007-07-13
     
  • Dieter Buecherl

    Dieter Buecherl - 2007-07-13

    Logged In: YES
    user_id=1842985
    Originator: YES

    and it happens also when you zoom out...

     
  • John Champion

    John Champion - 2007-08-10

    Logged In: YES
    user_id=957634
    Originator: NO

    Yes, this is by design. The "Band" is actually a GraphObj which is not constrained to the chart area by default. You can clip it to the chart area by using:

    box.IsClippedToChartRect = true;

    However, this will still allow the "band" to be smaller than the chart area. The best way to handle it is to use a hybrid coordinate system so that the Y coordinate of the band is in user scale units, but the X coordinate of the band is in chartfraction units. Setting the chart fraction to x1=0 and width=1.0 will make the band always equal the width of the chart rect, no matter what zoom setting you use.

    For example:
    BoxObj box = new BoxObj( 0.0, 100, 1.0, 30, Color.Empty, Color.FromArgb( 150, Color.LightGreen ) );
    box.Location.CoordinateFrame = CoordType.XChartFractionYScale;

    John

     

Log in to post a comment.