Page 1 of 1

The SaveToFile function fails when adding Series Circular

Posted: Fri Aug 10, 2012 10:56 am
by 16661989
Hi,
The version of TeeChart is 2010.0.0.3, SaveToFile funtion fails when adding Series Circular Gauge to TeeChart.Please see the following test Code

#include "stdafx.h"
using namespace std;

void RunTeeChart( );

int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize(NULL);

RunTeeChart( );

CoUninitialize();

return 0;
}

void RunTeeChart( )
{
using namespace TeeChart;
ITChartPtr chart1;
_com_util::CheckError(chart1.CreateInstance(__uuidof(TeeChart::TChart)));

chart1->SetTheme(TeeChart::EChartTheme::ctDefault,TeeChart::EColorPalette::cpTeeChart);

chart1->AddSeries(scBar);
chart1->AddSeries(scCircularGauge); //if delete this line the SaveToFile function will works well

for (int i = 0; i < chart1->SeriesCount; i++)
{
chart1->aSeries->Clear();
}

chart1->Export->SaveToFile(L"new.tee"); // SaveToFile fails and throw an exception
}

please tell me how to use it correctly or give me a fix , thanks.

Regards,
Haitao Sun
CA Technologies
Senior Software Engineer

Tel: +86-10-58162132
Fax:+86-10-58162300
Haitao.Sun@ca.com

Re: The SaveToFile function fails when adding Series Circular

Posted: Fri Aug 10, 2012 2:06 pm
by yeray
Hi Chen,

I've translated your code to VB6 and it seems to work fine for me with both v2010.0.0.3 and the actual v2012.0.0.8

Code: Select all

Private Sub Form_Load()
  TChart1.AddSeries scBar
  TChart1.AddSeries scCircularGauge
  
  TChart1.Export.SaveToFile "C:\tmp\new.tee"

  TChart1.ClearChart
  TChart1.Import.LoadFromFile "C:\tmp\new.tee"
End Sub
Please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.

Re: The SaveToFile function fails when adding Series Circular

Posted: Mon Aug 13, 2012 1:35 am
by 16661989
Hi Yeray,

you missed the following code

for (int i = 0; i < chart1->SeriesCount; i++)
{
chart1->aSeries->Clear();
}

Please add this and test it again.

Re: The SaveToFile function fails when adding Series Circular

Posted: Mon Aug 13, 2012 8:42 am
by yeray
Hi Chen,

Excuse me, you are right.
It seems there's a problem when exporting a CircularGauges that has been Cleared. I've added it to the wish list to be revised for next releases (TV52016300).
In the meanwhile, you could give a Value to this series before exporting it. Ie:

Code: Select all

TChart1.Series(i).asCircularGauge.Value = 0