Tooltip
Tooltip
Hi,
Is there an example how to set tooltip text in a pie, from MFC?
I read something about OnGetText event and GetMark but I can't really understand how.
I am using TChartProAtvicex control v6.
/ Jan
Is there an example how to set tooltip text in a pie, from MFC?
I read something about OnGetText event and GetMark but I can't really understand how.
I am using TChartProAtvicex control v6.
/ Jan
Hi Jan,
to change the text of the Marks in VC++ you can use similar code to the following in the OnGetMarkText event :
to change the text of the Marks in VC++ you can use similar code to the following in the OnGetMarkText event :
Code: Select all
CString strLabel(*LabelText);
strLabel = "My cutom Label";
strLabel.SetSysString(LabelText);
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Jan,
sorry, just a modification :
sorry, just a modification :
Code: Select all
void CGetXSeriesMarksDlg::OnOnGetSeriesMarkTchart1(long SeriesIndex, long ValueIndex, BSTR FAR* MarkText)
{
CString strLabel(*MarkText);
strLabel = "My cutom Label";
strLabel.SetSysString(MarkText);
}
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi,
I tried this. It just changes the label of the pie slices.
I whant to have a yellow tooltip that is displayed if uses puts mouse over the pie slies.
Pies are somettimes small, and the short text can be hard to understand. So I would like to display a longer description if user put mouse over whatever he dont understand.
/ Jan
I tried this. It just changes the label of the pie slices.
I whant to have a yellow tooltip that is displayed if uses puts mouse over the pie slies.
Pies are somettimes small, and the short text can be hard to understand. So I would like to display a longer description if user put mouse over whatever he dont understand.
/ Jan
OnOnMarkTipToolGetTextTchart
I tried to oerwrite "OnOnMarkTipToolGetTextTchart"
without any result.
Id did not display any tooltip at all. Is it need to turn on tooltip somewhere?
without any result.
Id did not display any tooltip at all. Is it need to turn on tooltip somewhere?
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi -
The following code works as expected here:I tried to oerwrite "OnOnMarkTipToolGetTextTchart"
without any result.
Id did not display any tooltip at all. Is it need to turn on tooltip somewhere?
Code: Select all
void CVCplus60TESTAXv6Dlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
m_Chart1.AddSeries(scPie);
m_Chart1.Series(0).FillSampleValues(10);
m_Chart1.GetTools().Add(tcMarksTip);
m_Chart1.GetTools().GetItems(0).GetAsMarksTip().SetSeries(COleVariant("Series0"));
m_Chart1.Series(0).GetMarks().SetVisible(false);
}
BEGIN_EVENTSINK_MAP(CVCplus60TESTAXv6Dlg, CDialog)
//{{AFX_EVENTSINK_MAP(CVCplus60TESTAXv6Dlg)
ON_EVENT(CVCplus60TESTAXv6Dlg, IDC_TCHART1, 37 /* OnMarkTipToolGetText */, OnOnMarkTipToolGetTextTchart1, VTS_I4 VTS_PBSTR)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
void CVCplus60TESTAXv6Dlg::OnOnMarkTipToolGetTextTchart1(long Tool, BSTR FAR* Text)
{
CString strLabel(*Text);
strLabel += " custom";
strLabel.SetSysString(Text);
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
tcMarksTip
I can't find the definition for tcMarksTip.
However it is listed in the manual.
TeeChartDefines.h
// EToolClass
const unsigned long tcCursor = 0;
const unsigned long tcDragMarks = 1;
const unsigned long tcAxisArrow = 2;
const unsigned long tcDraw = 3;
const unsigned long tcHints = 4;
const unsigned long tcColorband = 5;
const unsigned long tcColorLine = 6;
const unsigned long tcRotate = 7;
However it is listed in the manual.
TeeChartDefines.h
// EToolClass
const unsigned long tcCursor = 0;
const unsigned long tcDragMarks = 1;
const unsigned long tcAxisArrow = 2;
const unsigned long tcDraw = 3;
const unsigned long tcHints = 4;
const unsigned long tcColorband = 5;
const unsigned long tcColorLine = 6;
const unsigned long tcRotate = 7;
tcMarksTip = 8
Hi, Found the constant in manual. Not existing in headerfiles!
So now my tooltip is working. BUT! Major problem, it is one tooltip for hole Pie. I whant to display different tooltip for each item in a serie.
How can I do that?
/ Jan
From help:
Not all development environments support the direct call of TeeChart's Enum constants by name. See note on use of Enum constants for VBScript, MS VC++.
Integer Values:
tcCursor = 0
tcDragMarks = 1
tcAxisArrow = 2
tcDraw = 3
tcHints = 4
tcColorband = 5
tcColorLine = 6
tcRotate = 7
tcMarksTip = 8
tcChartImage = 9
tcAnnotate = 10
tcPageNumber = 11
TeeChart Pro ActiveX Control Documentation. Copyright 1997-2003 Steema Software SL.
So now my tooltip is working. BUT! Major problem, it is one tooltip for hole Pie. I whant to display different tooltip for each item in a serie.
How can I do that?
/ Jan
From help:
Not all development environments support the direct call of TeeChart's Enum constants by name. See note on use of Enum constants for VBScript, MS VC++.
Integer Values:
tcCursor = 0
tcDragMarks = 1
tcAxisArrow = 2
tcDraw = 3
tcHints = 4
tcColorband = 5
tcColorLine = 6
tcRotate = 7
tcMarksTip = 8
tcChartImage = 9
tcAnnotate = 10
tcPageNumber = 11
TeeChart Pro ActiveX Control Documentation. Copyright 1997-2003 Steema Software SL.
Works 100%
Hi,
Sorry, it works 100%. you just have to return different text, else it does not continue show the tooltip.
/ Jan
Sorry, it works 100%. you just have to return different text, else it does not continue show the tooltip.
/ Jan