Hi Dalvir,
Thanks for the screenshot. It is not possible to disable the dragging of interactive cursor. However it is possible to show lines along a particular point by drawing custom line using ChartAreaPaint event handler as given below.
Sample Code:
void chartControl1_ChartAreaPaint(object sender, PaintEventArgs e)
{
minLeft = this.chartControl1.ChartArea.RenderBounds.Left;
maxRight = this.chartControl1.ChartArea.RenderBounds.Right;
maxY = this.chartControl1.ChartArea.RenderBounds.Bottom;
minY = this.chartControl1.ChartArea.RenderBounds.Top;
using (Pen pen = new Pen(Color.FromArgb(220,60,60)))
{ pen.Width = 2;
float x = this.chartControl1.PrimaryXAxis.GetCoordinateFromValue(this.chartControl1.Series[0].Points[CustomLinesPointIndex].X);
float y = this.chartControl1.PrimaryYAxis.GetCoordinateFromValue(this.chartControl1.Series[0].Points[CustomLinesPointIndex].YValues[0]);
if (x >= minLeft && x <= maxRight) // Condition to disallow CustomGrid lines to draw outside the visible chartarea region
{
e.Graphics.DrawLine(pen, x, maxY, x, minY);// to draw Custom lines
}
if (y >= minY && y <= maxY) // Condition to Disallow labels to be drawn for the point that are ouside the visible chart area ( when chart is zoomed in).
{
e.Graphics.DrawLine(pen, minLeft, y, maxRight, y);// to draw Customlines
}
I have attached a sample illustrating the same in this link below.
http://websamples.syncfusion.com/samples/Chart.Windows/F74831/main.htmKindly let us know if this meets your requirement. Thanks for your patience.
Regards,
Manohari.R