MikeK Posted May 11, 2010 Report Share Posted May 11, 2010 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; } } } Quote Link to comment Share on other sites More sharing options...
MikeK Posted May 11, 2010 Author Report Share Posted May 11, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.