Jump to content
Software FX Community

Bug when adding series while zoomed in


MikeK

Recommended Posts

I have attached the code the will replicate this error.  Here are the steps to follow:

1) Click 'Zoom' and zoom in on a portion of the grid

2) Click "Add Series."  Notice how the chart is zoomed out even though from the Zoom Stripe (the long skinny chart along the bottom) shows that it is still zoomed in on the same area.  This is the first part of the bug.

 3) Click the Zoom Stripe selection box (the box that depicts the selected area on the long skinny graph) and move it left and right with the mouse.  All of the series disapear and you can not get it to reappear no matter where you scroll to on the chart.

--------------------------------XAML-----------------------------------------

<

Grid>

<Grid.RowDefinitions>

<RowDefinition Height="20" />

<RowDefinition Height="20" />

<RowDefinition Height="*" />

</Grid.RowDefinitions>

 

<Button Content="Zoom" Click="Button_Click" Grid.Row="0" />

<Button Content="Add Series" Click="Button_Click_1" Grid.Row="1" />

<cfx:Chart x:Name="_chart" Style="{x:Static cfxmotifs:Simple.Style}" Grid.Row="2"Palette="{x:Static cfx:Palettes.Basic}" MarkerTemplates="{x:Static cfx:MarkerTemplates.Glass}"

GalleryTemplates="{x:Static cfx:GalleryTemplates.Glass}">

</cfx:Chart>

</Grid>

 ---------------------------------- C# -----------------------------------------------------------

/// <summary>

/// Interaction logic for Window1.xaml

/// </summary>public partial class Window1 : Window {public Window1 () {

InitializeComponent ();

_chart.Gallery = Gallery.Line;

_chart.Series.Clear ();

_chart.AxesY.Clear ();

_chart.AxesX.Clear ();

_chart.Zoom.Style = ZoomStyle.Stripe;

ObservableCollection<RefPoint> series = new ObservableCollection<RefPoint> ();for (int i = 0; i < 200; ++i) {RefPoint refPoint = new RefPoint (i / 2, i / 10);

series.Add (refPoint);

}

 

SeriesAttributes sa = new SeriesAttributes ();

sa.BindingPath =

"Y";sa.BindingPathX = "X";

sa.ItemsSource = series;

sa.Content = "Test";Axis axisX = new Axis ();

_chart.AxesX.Add (axisX);

axisX.Title.Content = "X axis";

axisX.Min = 0;

axisX.Max = 100;

axisX.Step = 20;

sa.AxisX = axisX;

Axis axisY = new Axis ();

_chart.AxesY.Add (axisY);

axisY.Title.Content = "Y axis";

axisY.Min = 0;

axisY.Max = 20;

sa.AxisY = axisY;

 

_chart.Series.Add (sa);

}

private void Button_Click (object sender, RoutedEventArgs e) {_chart.Zoom.Mode = ZoomMode.Selection;

}

private void Button_Click_1 (object sender, RoutedEventArgs e) {ObservableCollection<RefPoint> series = new ObservableCollection<RefPoint> ();

for (int i = 0; i < 200; ++i) {RefPoint refPoint = new RefPoint (i / 3, i / 10);

series.Add (refPoint);

}

SeriesAttributes sa = new SeriesAttributes ();

sa.BindingPath =

"Y";sa.BindingPathX = "X";

sa.ItemsSource = series;

sa.Content = "Added Series";Axis axisX = new Axis ();

_chart.AxesX.Add (axisX);

axisX.Title.Content = "X axis";

axisX.Min = 0;

axisX.Max = 100;

//axisX.Step = 20;

sa.AxisX = axisX;

Axis axisY = new Axis ();

_chart.AxesY.Add (axisY);

axisY.Title.Content = "Y axis";

axisY.Min = 0;

axisY.Max = 20;

sa.AxisY = axisY;

_chart.Series.Add (sa);

}

}

public class RefPoint {public RefPoint (double x, double y) {

X = x;

Y = y;

}

public double X { get; set; }

public double Y { get; set; }

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...