Quantcast
Channel: oxyplot Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1267

New Post: Problem changing plot padding and axis position in code....

$
0
0
Hello,

I got a program that I am using OxyPlot.

I need to add Plots dynamically to a StackPanel.

My problems are the following.

If i define the Plot Padding and Margin, it is not followed.

I need to use DateTimeaxis. If I define the axis Position to AxisPosition.None it create a linear axix and ignore my DateTimeAxis.

Any help on that?

PS: Some code:

Here I set the DateTimeAxis Position
                    dateTimeAxis1 = new DateTimeAxis
                    {
                        CalendarWeekRule = CalendarWeekRule.FirstFourDayWeek,
                        FirstDayOfWeek = DayOfWeek.Monday,
                        MajorGridlineStyle = LineStyle.Solid,
                        MinorGridlineStyle = LineStyle.Dot,
                        Minimum = DateTimeAxis.ToDouble(FirstDate),
                        Maximum = DateTimeAxis.ToDouble(FinalDate),
                        IsPanEnabled = false,
                        IsZoomEnabled = false
                    };
                    if (IsFirstDay)
                        dateTimeAxis1.Position = AxisPosition.Top;
                    else
                        dateTimeAxis1.Position = AxisPosition.None;
                    plotModel.Axes.Add(dateTimeAxis1);
Here I set the Plot Margin and Padding
                    myPlot = new OxyPlot.Wpf.Plot()
                    {
                        Height = 150,
                        IsRendering = true
                    };

                    myPlot.Padding = new Thickness(5, 0, 15, 0);
                    myPlot.PlotMargins = new Thickness(0, 0, 0, 0);

Viewing all articles
Browse latest Browse all 1267

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>