AP
Amol Prakash
September 21, 2007 01:58 PM UTC
Also, is there a way to add a "tooltip" kind of feature to a custom point? i.e., a text shows up when the user hovers the mouse over the custom point?
>How can I change the text orientation of custom points? For example, make it vertical instead of horizontal. In general, how can I rotate it?
JS
Jeba S
Syncfusion Team
September 28, 2007 07:12 AM UTC
Hi Amol,
Thank you for your interest in Syncfusion Essential Studio.
Please refer the following details:
Query 1:Change the text orientation of custom points
The question you have posted has raised some very significant issues, as this might be a Feature Request. We will get back to you within 2 business days with a complete response after due analysis of these issues.
Query 2:Tooltip for a custom point
There is no direct property for setting Tooltip for a custom point but you can achieve this by handling the ChartRegionMouseEnter. In the event handler you can get the mouse point and convert the mouse point into chart point.Then check the chart point coordinates with the custom points X and Y values and set the Tooltip accordingly.
ChartCustomPoint cp2=new ChartCustomPoint();
// Point that uses chart coordinates
cp2.CustomType = ChartCustomPointType.ChartCoordinates;
cp2.XValue = 2003;
cp2.YValue = 289;
cp2.Symbol.Shape = ChartSymbolShape.Diamond;
cp2.Alignment = ChartTextOrientation.Smart;
cp2.Color = Color.SkyBlue;
cp2.Symbol.Color = Color.Red;
cp2.Text = "(Any X,Y value in the plot)";
this.chartControl1.CustomPoints.Add(cp2)
ToolTip toolTip1 = new ToolTip();
private void chartControl1_ChartRegionMouseEnter(object sender, ChartRegionMouseEventArgs e)
{
Point mousePoint = new Point(e.Point.X, e.Point.Y);
ChartPoint chpt = chartControl1.ChartArea.GetValueByPoint(new Point(e.Point.X, e.Point.Y));
if ((chpt.X==cp2.XValue) &&(chpt.YValues[0]==cp2.YValue))
{
toolTip1.SetToolTip(chartControl1, "Over custom points");
}
}
Kindly let us know if you need any further assistance.
Best Regards,
Jeba.
ML
Mia Lee
April 21, 2009 10:17 PM UTC
ChartCustomPoint cp2=new ChartCustomPoint();
// Point that uses chart coordinates
cp2.CustomType = ChartCustomPointType.ChartCoordinates;
cp2.XValue = 2003;
cp2.YValue = 289;
cp2.Symbol.Shape = ChartSymbolShape.Diamond;
cp2.Alignment = ChartTextOrientation.Smart;
cp2.Color = Color.SkyBlue;
cp2.Symbol.Color = Color.Red;
cp2.Text = "(Any X,Y value in the plot)";
this.chartControl1.CustomPoints.Add(cp2)
ToolTip toolTip1 = new ToolTip();
private void chartControl1_ChartRegionMouseEnter(object sender, ChartRegionMouseEventArgs e)
{
Point mousePoint = new Point(e.Point.X, e.Point.Y);
ChartPoint chpt = chartControl1.ChartArea.GetValueByPoint(new Point(e.Point.X, e.Point.Y));
if ((chpt.X==cp2.XValue) &&(chpt.YValues[0]==cp2.YValue))
{
toolTip1.SetToolTip(chartControl1, "Over custom points");
}
}
I have tried the above code (version 7.1) and even though I am over the custom chart, it is not displaying the tooltip.
Any ideas?
MS
Manimala S
Syncfusion Team
April 22, 2009 01:24 PM UTC
Hi Lee,
Just include the below line in the form_load event.
this.chartControl1.ShowToolTips = true;
This will solve your issue.
Kindly, let me know if it works.
Thanks,
Manimala
ML
Mia Lee
April 22, 2009 03:48 PM UTC
It is set to true. When I click anywhere in the custom chart point, the chartPoint is not equalling the custom chart point. It's close but not close enough to make the tool tip come up.
any ideas??
Does z order or ChartDateTimeIntervalType.Auto have anything to do with it???
ML
Mia Lee
April 22, 2009 04:02 PM UTC
It is set to true. When I click anywhere in the custom chart point, the chartPoint is not equalling the custom chart point. It's close but not close enough to make the tool tip come up.
any ideas??
Does z order or ChartDateTimeIntervalType.Auto have anything to do with it???
MS
Manimala S
Syncfusion Team
April 23, 2009 02:25 PM UTC
Hi Lee,
I am working on it. will update you once I have got that.
Thanks,
Manimala.
MS
Manimala S
Syncfusion Team
April 24, 2009 07:17 AM UTC
Hi Lee,
I was not able to reproduce your issue. Can you please send me the sample, so that I can analyze and give you the solution.
Thanks,
Manimala.