0

I don't know how to describe my problem so I try to show you:

These ellipses are actually circles

These ellipses are actually circles. When I resize the window I can get that:

enter image description here

Like you see, now I have a circles, but sometimes despite the window resize, I can't get it. If anybody know what I need to change that I don't need to resize anymore?

This is my plot window:

<Window x:Class="View.Views.PlotWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:oxy="http://oxyplot.org/wpf"
    Title="PlotWindow" MinHeight="600" MinWidth="800" WindowStartupLocation="CenterScreen">

    <oxy:PlotView Model="{Binding PlotModel}" />

</Window>

and methods creating plot model.

public override PlotModel DrawPlot(Data data)
        {
            ObservableCollection<Radial> radials = ((RdData)data).Radials;
            if (data.Records[0].Items.Count > 2)
                return null;
            PlotModel model = new PlotModel();
            int i = 0;
            foreach (var r in radials)
            {
                var rad = generateRadialFunc(r);
                var series = new FunctionSeries();
                foreach (var p in rad)
                {
                    series.Points.Add(new DataPoint(p[0], p[1]));
                }
                series.MarkerSize = 2;
                series.MarkerStrokeThickness = 1;
                series.Title = "Radial (" + string.Format("{0:N2}", r.centerCoordinates.Items[0].Value) + ';' + string.Format("{0:N2}", r.centerCoordinates.Items[1].Value) + ')';
                i++;
                model.Series.Add(series);
            }
            scatterAndAxis(model, data);

            return model;
        }

        protected double[][] generateRadialFunc(Radial radial)
        {
            double[][] rad = new double[3600][];
            int j = 0;
            for (double i = 0.0; i <= 360.0; i+=0.1)
            {
                rad[j] = new double[2];
                double angle = i * Math.PI / 180;
                rad[j][0] = radial.centerCoordinates.Items[0].Value + radial.R * Math.Cos(angle);
                rad[j][1] = radial.centerCoordinates.Items[1].Value + radial.R * Math.Sin(angle);
                j++;
            }
            return rad;
        }
mar14
  • 85
  • 1
  • 8
  • what is the problem exactly? When you resize the window, stays circles as it is and they are also supposed to resize – Ugur May 31 '16 at 07:15
  • 1
    To fix the width and height, you should give the size of the PlotView, e.g. Width = "500" Height = "500" – Ugur May 31 '16 at 07:18
  • 1
    I find other solution, change plot model type to Cartesian. Thanks for your attention.;) – mar14 Jun 01 '16 at 10:44
  • You are welcome, good to know it. – Ugur Jun 01 '16 at 12:03

0 Answers0