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.
Unfortunately, activation email could not send to your email. Please try again.

how to disable interactive cursor..

Thread ID:

Created:

Updated:

Platform:

Replies:

74831 Jun 30,2008 07:29 AM Jul 1,2008 03:14 PM Windows Forms 1
loading
Tags: Chart
Administrator [Syncfusion]
Asked On June 30, 2008 07:29 AM

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

Manohari [Syncfusion]
Replied On July 1, 2008 03:14 PM

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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;