Oxyplot lineseries和linearaxis [英] Oxyplot lineseries and linearaxis

查看:331
本文介绍了Oxyplot lineseries和linearaxis的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我想这样做,

lineseris1和Y1相互依赖。(Y1是左轴)

lineseris2和Y2相互依赖。(Y2是右轴)



当我按下右键时,我拖动了lineseries并且只是改变了左轴( lineseries1),我希望它移动两个轴(左轴和右轴)。

另外,

当lineseries1根据接收值重新缩放时,左轴必须改变。

当lineseries2根据接收值重新缩放时,右轴必须更改。



我尝试过: < br $> b $ b

Hi friends,
I want to do that,
lineseris1 and Y1 depends on each other.(Y1 is left axis)
lineseris2 and Y2 depends on each other.(Y2 is right axis)

When I keep to press the right click ,I am dragging the lineseries and just changing left axis(lineseries1),I want it to move both axis(left and right axis).
Also,
When the lineseries1 rescale according to receiving values,left axis must change .
When the lineseries2 rescale according to receiving values,right axis must change.

What I have tried:

<pre lang="c#">        

 LineSeries lineSeries1 = new LineSeries
        {
            StrokeThickness = 2,

            Title = "Value1",
            Smooth = false,
            Color = OxyColor.FromArgb(255, 78, 154, 6),
            MarkerFill = OxyColor.FromArgb(255, 78, 5, 6),
            MarkerStroke = OxyColors.ForestGreen,
            MarkerType = MarkerType.Circle,
            DataFieldX = "Date",
            DataFieldY = "Value"    
        };

        LineSeries lineSeries2 = new LineSeries
        {
            StrokeThickness = 2,
            CanTrackerInterpolatePoints = true,
            Title = "Value2",
            Smooth = true
        };

        LinearAxis linearAxisY1 = new LinearAxis {
            Title = "Y1",
            Position = AxisPosition.Left,
            MajorGridlineColor = OxyColor.FromArgb(40, 100, 0, 139),
            MajorGridlineStyle = LineStyle.Solid,
            MinorGridlineColor = OxyColor.FromArgb(20, 0, 0, 139),
            MinorGridlineStyle = LineStyle.Solid
        };

        LinearAxis linearAxisY2 = new LinearAxis {
            Title = "Y2",
            Position = AxisPosition.Right,
        };

        LinearAxis linearAxisX1 = new LinearAxis
        {
            Title = "X1",
            Position = AxisPosition.Bottom,
            MajorGridlineColor = OxyColor.FromArgb(40, 0, 0, 139),
            MajorGridlineStyle = LineStyle.Solid,
            MinorGridlineColor = OxyColor.FromArgb(20, 0, 0, 139),
            MinorGridlineStyle = LineStyle.Solid

        };

 pv.Model = new PlotModel() {Title="ABC", Background = OxyColors.Beige };

            
            pv.Model.InvalidatePlot(true);
            pv.Model.Axes.Clear();

            //pv.Model.Axes.Add(linearAxisX1);
            pv.Model.Axes.Add(linearAxisY1);
            pv.Model.Axes.Add(linearAxisY2);

            pv.Model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, MajorGridlineStyle = LineStyle.Solid,
                MinorGridlineStyle = LineStyle.Solid,
 
            });

            
            lineSeries1.Points.Clear();

            pv.Model.Series.Add(lineSeries1);
            pv.Model.Series.Add(lineSeries2);

推荐答案

为什么不使用Oxyplot推荐的资源来支持:[ ^ ]
Why not use the Oxyplot recommended resources for support: [^]
引用:

问题

如果您对库有疑问,请使用discussion.oxyplot.org上的论坛。您也可以尝试聊天室,Stack Overflow或Xamarin论坛。

Questions
Use the discussion forum at discussion.oxyplot.org if you have questions regarding the library. You can also try the chat room, Stack Overflow or the Xamarin forum.


这篇关于Oxyplot lineseries和linearaxis的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆