How do you assigned a Series to the Tool Cursor Snap via programming?
I am trying to assign a first Series to Tool cursor snap via programming. I read the document that is state:
ICurstorTool Property Snap: WordBool; Type Library TeeChartx Description Set Snap property to True to align the TCursorTool with the nearest series point. Snap has no effect unless a series is assigned to the Series property.
My code:
m_lCursor1 = pToolList->Add((tchartNS::EToolClass)tcCursor);
tchartNS::IToolsPtr pToolsPtr(pToolList->GetItems(m_lCursor1));
m_pCursor = pToolsPtr->GetasTeeCursor();
m_pCursor->PutStyle((tchartNS::ECursorToolStyle)cssVertical);
m_pCursor->GetPen()->PutEndStyle((tchartNS::EPenEndStyle)esFlat);
m_pCursor->GetPen()->PutColor(RGB(0,120,0));
m_pCursor->PutSnap(VARIANT_TRUE);
m_pCursor->Series = 0; <<<<<<<<< Doesn't assign to Series0?
Yes :). To assign the Series to a TeeCursorTool you should create a Variant variable. Then you should assign the Series in that. The code below shows how you can do it:
Could you tell us if the code works in your end?