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(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);