hello, dear
Lightning chart is vary useful for me. so thanks
And I have one question. I have many point line series and area series. Series have each Y axis.
but I want to all Yaxis value of just One Constant line.
Is it possible??
if that possible then send to some example or reply please.
thanks.
multi sync to ConstantLine
Moderator: Queue Moderators
-
- Posts: 14
- Joined: Mon Jul 03, 2017 8:43 am
multi sync to ConstantLine
- Attachments
-
- capture.jpg (124.92 KiB) Viewed 8648 times
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: multi sync to ConstantLine
Hello Jung,
Could you clarify your question a little bit?
If you want to assign single ConstantLine to all y axes, it is not possible?!
Are your drawing ConstantLine at same value for each y-axes, but want them be on same vertical location (on the screen)?
Please clarify.
All the best.
Could you clarify your question a little bit?
If you want to assign single ConstantLine to all y axes, it is not possible?!
Are your drawing ConstantLine at same value for each y-axes, but want them be on same vertical location (on the screen)?
Please clarify.
All the best.
-
- Posts: 14
- Joined: Mon Jul 03, 2017 8:43 am
Re: multi sync to ConstantLine
my chart drawing ConstantLine at different value for each Yaxis, but screen position is same.
because user want to individual scaling at Y axis.
so it is not possible. Do you have not any solution?? I will must do it. please...
because user want to individual scaling at Y axis.
so it is not possible. Do you have not any solution?? I will must do it. please...
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: multi sync to ConstantLine
Hello Jung,
Your task could be formulated as following: pan all available Axes for constant line to overlap, right?
The simplest workflow is to read ConstantLine.Value, estimate NEW Minimum & Maximum of Yaxis (while keeping Y range the same) and set new Range.
For example,
The code above places ConstantLine in the middle of GraphicArea. Therefore, you see multiplier 0.5. You can have ConstantLine at any location by simple changing this multiplier (just it should sum of 1 for NewMax and NewMin).
Hope this helps.
All the best.
Your task could be formulated as following: pan all available Axes for constant line to overlap, right?
The simplest workflow is to read ConstantLine.Value, estimate NEW Minimum & Maximum of Yaxis (while keeping Y range the same) and set new Range.
For example,
Code: Select all
private void UpdateYaxesRange()
{
int axesCount = _chart.ViewXY.ConstantLines.Count;
_chart.BeginUpdate();
for (int i = 0; i < axesCount; i++)
{
ConstantLine cls = _chart.ViewXY.ConstantLines[i];
AxisY yAxis = _chart.ViewXY.YAxes[cls.AssignYAxisIndex];
double newMax = cls.Value + (yAxis.Maximum - yAxis.Minimum) * 0.5;
double newMin = cls.Value - (yAxis.Maximum - yAxis.Minimum) * 0.5;
yAxis.SetRange(newMin, newMax);
}
_chart.EndUpdate();
}
Hope this helps.
All the best.
-
- Posts: 14
- Joined: Mon Jul 03, 2017 8:43 am
Re: multi sync to ConstantLine
hello, dear
thanks for reply
but my chart use to different Yaxis range
so, i looking for differ solution.
Because i will must do it. If you find the other solution, talk to me, please
Best Regards.
thanks for reply
but my chart use to different Yaxis range
so, i looking for differ solution.
Because i will must do it. If you find the other solution, talk to me, please
Best Regards.
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: multi sync to ConstantLine
Hello,
If you want to zoom as well, when you should add/subtract same amount to Axis' Maximum/Minimum. If you maintain symmetry, the ConstantLine will at the same screen coordinate.
If you want to zoom as well, when you should add/subtract same amount to Axis' Maximum/Minimum. If you maintain symmetry, the ConstantLine will at the same screen coordinate.