The SaveToFile function fails when adding Series Circular

TeeChart for ActiveX, COM and ASP
Post Reply
Chen Yang
Newbie
Newbie
Posts: 26
Joined: Tue Mar 20, 2012 12:00 am

The SaveToFile function fails when adding Series Circular

Post by Chen Yang » Fri Aug 10, 2012 10:56 am

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

Yeray
Site Admin
Site Admin
Posts: 9587
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The SaveToFile function fails when adding Series Circular

Post by Yeray » Fri Aug 10, 2012 2:06 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Chen Yang
Newbie
Newbie
Posts: 26
Joined: Tue Mar 20, 2012 12:00 am

Re: The SaveToFile function fails when adding Series Circular

Post by Chen Yang » Mon Aug 13, 2012 1:35 am

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.

Yeray
Site Admin
Site Admin
Posts: 9587
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The SaveToFile function fails when adding Series Circular

Post by Yeray » Mon Aug 13, 2012 8:42 am

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
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply