in

Software FX Community

Discuss and find help for all Software FX products.

Map style Zoom causes exception when chart contains Annotation

Last post 05-12-2010 2:09 PM by JuanC. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-13-2010 11:50 AM

    • Coder
    • Top 200 Contributor
    • Joined on 12-30-2008

    Map style Zoom causes exception when chart contains Annotation

    I have version 8.0.3629.29517.

    When I try to zoom a chart with Zoom.Style set to Map and my chart contains an Annotation I get an exception.  Here is an example.  Double-click the chart to enter zoom selection mode.

    With this object defined...

    private class DateValue
    {
       
    public DateTime Date { get; set; }
       
    public double Value { get; set; }
       
    public DateValue(DateTime date, double value)
        {
           
    Date = date;
            Value = value;
        }
    }

    This recreates the problem...

    Chart chart1 = new Chart();
    chart1.Width = 1024.0;
    chart1.Height = 768.0;
    chart1.LegendBox.Visibility =
    Visibility.Collapsed;

    Random rnd = new Random(123);
    List<DateValue> list1 = new List<DateValue>();

    for
    (int i = 0; i < 100; i++)
    {
        list1.Add(
    new DateValue(DateTime.Today.AddYears(-2).AddDays(i * 7), (double)rnd.Next(0, 200)));
    }

    Axis axisX = new Axis();
    Axis axisY = new Axis();
    axisX.DataFormat.Format =
    AxisFormat.Date;
    axisX.Labels.HorizontalAlignment =
    HorizontalAlignment.Right;
    axisX.Labels.Position =
    AxisLabelPosition.Center;
    axisX.Labels.Format =
    AxisFormat.Date;
    axisX.Min =
    DateTime.Today.AddYears(-2);
    axisX.Max =
    DateTime.Today;
    axisX.FontSize = 14;
    axisX.Title.Content =
    "Test";
    axisX.Title.FontSize = 14.0;
    axisY.Min = 0.0;
    axisY.Max = 200.0;
    axisY.AxisStyle =
    AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel;
    axisY.Labels.Decimals = 1;
    chart1.AxesX.Clear();
    chart1.AxesY.Clear();
    chart1.AxesX.Add(axisX);
    chart1.AxesY.Add(axisY);

    SeriesAttributes sa = new SeriesAttributes();
    sa.Gallery = chart1.Gallery =
    Gallery.Line;
    sa.ItemsSource = list1;
    sa.BindingPath =
    "Value";
    sa.BindingPathX =
    "Date";
    sa.Content =
    "Test";
    sa.AxisX = axisX;
    sa.AxisY = axisY;
    chart1.Series.Add(sa);
    chart1.MouseDoubleClick +=
    delegate
    {
        chart1.Zoom.Style =
    ZoomStyle.Map;
        chart1.Zoom.Mode =
    ZoomMode.Selection;
    };

    Annotations anno = new Annotations();
    TextBlock tb = new TextBlock();
    tb.Text =
    "Test";
    tb.HorizontalAlignment =
    HorizontalAlignment.Left;
    tb.VerticalAlignment =
    VerticalAlignment.Bottom;
    tb.FontSize = 20.0;
    Annotations.SetAttachX(tb, axisX.Min);
    Annotations.SetAttachY(tb, axisY.Min);
    Annotations.SetAxisX(tb, axisX);
    Annotations.SetAxisY(tb, axisY);
    anno.Children.Add(tb);
    chart1.Extensions.Add(anno);

  • 05-11-2010 10:44 AM In reply to

    • MikeK
    • Top 200 Contributor
    • Joined on 05-10-2010

    Re: Map style Zoom causes exception when chart contains Annotation

    Is there any update on this issue?  I am having the same exact problem.

  • 05-12-2010 2:09 PM In reply to

    • JuanC
    • Top 10 Contributor
    • Joined on 03-02-2007

    Re: Map style Zoom causes exception when chart contains Annotation

    This issue will be fixed on build 3784 or later which should be available in a day or two. Please note that the annotations will show on the zoomed area but not the map, this is similar to our current behavior when using zoom stripe. To show it in both would require cloning all the annotation objects which might not be always possible.

    I apologize for our delay fixing this issue, even though the original posting was done on January, this issue was never added to our bug database so we were not actively working on it.

    JuanC

Page 1 of 1 (3 items)
Copyright 2008 Software FX, Inc.