Page 1 of 1

Series Enter/ Series Exit events after an XML import

Posted: Tue May 17, 2005 7:22 am
by 9525039
strange problem


My app allows live data capture and restoring from a saved file. The saved file being saved in XML format.

I have a MouseEnterSeries and MouseLeaveSeries Event handler which displays the current values of the series being hovered over.

In Live Capture mode this works fine, however when I load a previously stored XML data file the event handler does not fire when I hover over the series.

Code to read the XMl is

m_XMLSource->PutActive(false);
m_XMLSource->PutFileName(FullPathAndFilename);
m_XMLSource->PutActive(true);

The strangeness begins when I switch the app to save in Native Teechart format. If I now load a native TeeChart format data file the event handler works again.

Is this behaviour a result of using a XMLSource to do the data import and is there a way I can use a XMLSource and still have events fired when I enter and leave a series ?

Posted: Tue Jun 14, 2005 8:32 am
by narcis
Hi AR,

Please find below a working example of exporting and importing charts in XML. Sorry for the VB code but you shouldn't have any problem porting it to any other language.

Code: Select all

Private Sub Command1_Click()
    With TChart1.Export.asXML
        .IncludeHeader = True
        .IncludeIndex = True
        .IncludeLabels = True
        .Series = 0
        .SaveToFile "C:\chart.xml"
    End With
End Sub

Private Sub Command2_Click()
  With SeriesXMLSource1
    .FileName = "C:\chart.xml"
    .Series = TChart1.Series(0)
    .SeriesNode = "Series0"
    .ValueSource = "Y"
    .Open
  End With
End Sub

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 10
End Sub

Private Sub TChart1_OnMouseEnterSeries(ByVal SeriesIndex As Long)
    TChart1.Header.Text.Clear
    TChart1.Header.Text.Add "Mouse Entered Series"
End Sub

Private Sub TChart1_OnMouseLeaveSeries(ByVal SeriesIndex As Long)
    TChart1.Header.Text.Clear
    TChart1.Header.Text.Add "Mouse Left Series"
End Sub
In case you are still having problems could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.