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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to show dates with fancytooltip

Thread ID:





74318 Jun 6,2008 07:22 PM UTC Oct 7,2013 06:20 AM UTC WinForms 3
Tags: Chart
Asked On June 6, 2008 07:22 PM UTC

i have a chart which is using a datattable to access the values x and y values. x values are dates. if i use fancy tool tip the date part comes up wierd. is there a special way to handle dates in sycnfusion for fancytooltip to display.

below is the src code for the chart
ChartSeries series = this._viewControl.Model.NewSeries("Time Line Chart");// , ChartSeriesType.StepLine);
ChartDataBindModel model = new ChartDataBindModel(ds, "dat1");
this._viewControl.model = model;
model.XName = "Date";
model.YNames = new string[] { "values" };
series.SeriesModelImpl = model;
series.Type = ChartSeriesType.StepLine;
this._viewControl.Indexed = false;
this._viewControl.PrimaryXAxis.DrawGrid = true; ;
this._viewControl.PrimaryYAxis.DrawGrid = true;
this._viewControl.PrimaryXAxis.AutoValueType = false;
this._viewControl.PrimaryXAxis.ValueType = ChartValueType.DateTime;
this._viewControl.PrimaryXAxis.DateTimeFormat = "MM/dd/yyyy";
this._viewControl.PrimaryXAxis.LabelIntersectAction = ChartLabelIntersectAction.MultipleRows;
//set Chart Axis Range
this._viewControl.ChartArea.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this._viewControl.ChartArea.PrimaryYAxis.Range.Min = 0;
this._viewControl.ChartArea.PrimaryYAxis.Range.Max = 191875553;
this._viewControl.Legend.Visible = true;
this._viewControl.Series3D = true;
// The Primary Axes are set with DateTime values.
this._viewControl.PrimaryXAxis.IntervalType = ChartDateTimeIntervalType.Days;

// Avoids overlapping of Axes labels.
this._viewControl.PrimaryXAxis.LabelIntersectAction = ChartLabelIntersectAction.Rotate;
//information abt chart labels
this._viewControl.Text = "TIme Line Chart";
this._viewControl.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

//zooming for chart
this._viewControl.EnableXZooming = true;
this._viewControl.ZoomFactorX = .5;
this._viewControl.EnableYZooming = true;
this._viewControl.ZoomFactorY = .5;
this._viewControl.HidePartialLabels = false;

// Display ToolBar

this._viewControl.ShowToolbar = true;
this._viewControl.ToolBar.DockingFree = true;

// Chart Area Tooltips
// this._viewControl.ShowToolTips = true;
//this._viewControl.ChartToolTip= "Chart Area";

// Series points Tooltips
//series.PointsToolTipFormat = "Notional:{{4}";
series.FancyToolTip.Visible = true;
series.FancyToolTip.Alignment = TabAlignment.Top;

//implement InteractiveCursor in a chart
// ChartInteractiveCursor Icursor = new ChartInteractiveCursor(_viewControl.Model.Series[0]);

// Set the range for the Axes.
DateTime date1;
date1 = DateTime.Now;
this._viewControl.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;
this._viewControl.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(date1, date1.AddMonths(150), 15, ChartDateTimeIntervalType.Months);
//this._viewControl.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(date1, date1.AddYears(20), 1, ChartDateTimeIntervalType.Years);

J.Nagarajan [Syncfusion]
Replied On June 16, 2008 12:30 PM UTC

Hi Warude ,

If your intention is to show the tooltip of DateTime values of X axis when hovering the series, then you have to handle ChartRegionMouseHover event and have to find the correct series value by getting corresponding Chart point from mouse coordinate. Then you have to display its using external tooltip. Please refer to the attached sample that demonstrates this completely.


Please let me know if this helps.


Replied On July 17, 2013 12:36 AM UTC

   I have the same problem. I couldn't open the sample url. Can you provide me the new link to that sample? Thank you.


Anandaraj T [Syncfusion]
Replied On October 7, 2013 06:20 AM UTC

Hi Wen,

Thanks for using Syncfusion products.

The sample url link is currently not available, so we have created a simple sample for displaying date time values in tooltip.

Please refer the following code snippet to achieve this:




        void series_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)


            ChartSeries series = sender as ChartSeries;

            args.Style.ToolTip = "XValue: " + series.Points[args.Index].DateX + "\nYValue: " + series.Points[args.Index].YValues[0];



For more information about tooltip, please refer our online documentation in the following link:


Please let us know if you have any concern.





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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon