We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

how to disable interactive cursor..

hi Experts...

i need to show the lines corresponding to x-axis and y-axis alonge with a point. i m using interactive cursor for that. but i m just unable to disable to cursor so that i can show only the lines across the axes but not let the user to interacte with it.
if any other way is possible plz let me know. the attached image will show u more what i need.
thanks
dalvir singh



lines across point_2b7ff22c.zip

1 Reply

MA Manohari Syncfusion Team July 1, 2008 07:14 PM UTC

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.htm

Kindly let us know if this meets your requirement. Thanks for your patience.

Regards,
Manohari.R



Loader.
Live Chat Icon For mobile
Up arrow icon