Legend Custom Position
Posted: Thu Feb 08, 2018 3:08 pm
Hi Steema support,
We are facing one problem regarding the legend position on Chart. We are using the Dot Net TChart version 2012.
The problem is that we set the legend position on the chart and then close the chart again we open same chart the legend doesn't show at previous position.
We set the legend position on Resize and GetLegendPos events. In these events we write the below code is as follows:-
double px = XLegendLocation;
double py = YLegendLocation;
if (this.Series.Count > 0)
{
px = this.Series[0].ValuePointToScreenPoint(px, 0).X;
py = this.Series[0].ValuePointToScreenPoint(0, py).Y;
}
this.Legend.Top = Convert.ToInt32(py);
this.Legend.Left = Convert.ToInt32(px);
But when we click on chart the legend position is set to the previous location.
We don't know whether it is a refreshing issue or some other problem. Kindly guide us.
Thanks & regards
Plano research
We are facing one problem regarding the legend position on Chart. We are using the Dot Net TChart version 2012.
The problem is that we set the legend position on the chart and then close the chart again we open same chart the legend doesn't show at previous position.
We set the legend position on Resize and GetLegendPos events. In these events we write the below code is as follows:-
double px = XLegendLocation;
double py = YLegendLocation;
if (this.Series.Count > 0)
{
px = this.Series[0].ValuePointToScreenPoint(px, 0).X;
py = this.Series[0].ValuePointToScreenPoint(0, py).Y;
}
this.Legend.Top = Convert.ToInt32(py);
this.Legend.Left = Convert.ToInt32(px);
But when we click on chart the legend position is set to the previous location.
We don't know whether it is a refreshing issue or some other problem. Kindly guide us.
Thanks & regards
Plano research