Hi Steema,
We have one query regarding the tooltip as shown in the attached image, i am showing tooltip using Markstip Tool.
But in my case X scale is plotted with "date-time" values and Y axis use double value and we are using candle series.
And i am using below code-
StringBuilder sb = new StringBuilder("");
sb.Append("Time: ");
sb.Append(e.Text);
So when we are using this e.Text property, it gives X value in double format i.e "42,739" and Y value is "122.545" so here Y value is correct but X value is not in Datetime format.
i also used method ---scandleSeries1.ScreenPointToValuePoint(e.X,0).X; for this but still this method does not able to convert this double value to date time.
Please provide any solution asap.
Thanks in advance.
Planoresearch
Tooltip for DateTime format
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tooltip for DateTime format
Hello Amol,
Apologies for the delay in this reply.
This code:
will give you this result:
to modify the DateTime string you can use the GetText event, e.g.
Apologies for the delay in this reply.
This code:
Code: Select all
private void InitializeChart()
{
Candle series = new Candle(tChart1.Chart);
series.FillSampleValues();
MarksTip tool = new MarksTip(tChart1.Chart);
tool.Style = MarksStyles.XY;
}
Code: Select all
private void InitializeChart()
{
Candle series = new Candle(tChart1.Chart);
series.FillSampleValues();
MarksTip tool = new MarksTip(tChart1.Chart);
tool.Style = MarksStyles.XY;
tool.GetText += Tool_GetText;
}
private void Tool_GetText(MarksTip sender, MarksTipGetTextEventArgs e)
{
string text = e.Text;
string[] lines = text.Split(' ');
DateTime dt = DateTime.Parse(lines[0]);
e.Text = dt.ToLongDateString() + " " + lines[1];
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |