Jump to content
Software FX Community

nicovil

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About nicovil

  • Rank
    Newbie
  1. Hello. I'm trying to add an annotation to my chart using VC++, but they are not showed at all on the chart. I'm using this code snippet (VC++) using COM interface... m_chartPtr is the chart instance which is rendering perfect. Cfx62ClientServerAnnotation::_AnnotationXPtr annotx; HRESULT rs = annotx.CreateInstance(__uuidof(Cfx62ClientServerAnnotation::AnnotationX)); if (rs == S_OK) { annotx->Enabled = TRUE; Cfx62ClientServerAnnotation::_AnnotationTextPtr text; rs = text.CreateInstance(__uuidof(Cfx62ClientServerAnnotation::AnnotationText)); annotx->List->Add(text); if (rs == S_OK) { text->Attach(Cfx62ClientServerAnnotation::StringAlignment::StringAlignment_Near, 2, Cfx62ClientServerAnnotation::StringAlignment::StringAlignment_Far, 62); text->TextColor = RGB(255, 0, 0); text->Text = "Sample text"; text->Color = m_chartPtr->ColorFromArgb(0, 0, 0, 0); text->Border->Color = m_chartPtr->ColorFromArgb(0, 0, 0, 0); text->Orientation = 0; text->Align = Cfx62ClientServerAnnotation::StringAlignment::StringAlignment_Far; text->LineAlignment = Cfx62ClientServerAnnotation::StringAlignment::StringAlignment_Near; text->Top = 40; text->Left = 40; rs = text->SizeToFit(); if (rs == S_OK) { VARIANT v; V_VT(&v) = VT_DISPATCH; V_DISPATCH(&v) = annotx; m_chartPtr->Extensions->Add(v); } } } Is the code wrong? Any help will be really appreciated! Regards!
×
×
  • Create New...