Jump to content
Software FX Community

Problem with Stripe Zoom on Line Chart


MikeK

Recommended Posts

I have a couple of problems with zoom for line charts when zoom style 'stripe' is selected.

The first problem is that if you zoom in two to three times (for some reason it only takes twice with my real application, but more with the sample app I included below) the chart will zoom out the entire way and then have no x-axis displayed.

The second problem, is if this occurs and you try resizing the area to be displayed on the stripe chart it crashes.

 

using

System;

using

System.Collections.Generic;

using

System.Linq;

using

System.Text;

using

System.Windows;

using

System.Windows.Controls;

using

System.Windows.Data;

using

System.Windows.Documents;

using

System.Windows.Input;

using

System.Windows.Media;

using

System.Windows.Media.Imaging;

using

System.Windows.Navigation;

using

System.Windows.Shapes;

using

ChartFX.WPF;

using

System.Collections.ObjectModel;namespace WpfApplication1 {

 

/// <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;

List<RefPoint> series = new List<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;

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;

}

}

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

UPDATE:

To make the problem more apparent and easily happen on the first zoom add the line :

axisX.Step = 20;

 

When I read the documentation about step it reads:

"Specifies the interval of major tick marks and gridlines on the selected axis.

It also controls the gap or interval between labels in the selected axis."

I do not believe it should have the functionality where I can not zoom smaller than an interval of the step property.

 

Any help on resolving these issues is appreciated. 

 

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...