Dear Support, I have some troubles

TeeChart for ActiveX, COM and ASP
Post Reply
Gobing
Newbie
Newbie
Posts: 6
Joined: Fri Jan 11, 2008 12:00 am
Location: Chengdu City, Sichuan Province, PRC
Contact:

Dear Support, I have some troubles

Post by Gobing » Tue Jun 09, 2009 4:10 pm

Dear Support :) ,
I’m afraid I have to disturb me again. I added a “Numeric Gauge” series to the TeeChart(ActiveX) control. Then I wrote the following codes in my program:
m_TChart.Series(0).SetValueFormat("10:00");
When I ran my program, I found that the result displayed on the dialog is “10:04”. The last number ‘0’ became ‘4’. I also found that this phenomenon is very common in any number sequence.

In “Polar” or “Point” series, I want to know whether the return value is the index of new generated point for the function:
int nIndex = m_TeeChart.Series(0).GetAsPolar().AddPolar()
But I found that, the collection of “nIndex” had several repeated values, when using a loop to generate several points. So I doubted the return value of the function mentioned before is not the index.

I also want to know how to get the index of the specified point in a series?

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

Post by Yeray » Wed Jun 10, 2009 8:20 am

Hi Gobing,
Gobing wrote:I added a “Numeric Gauge” series to the TeeChart(ActiveX) control. Then I wrote the following codes in my program:
m_TChart.Series(0).SetValueFormat("10:00");
When I ran my program, I found that the result displayed on the dialog is “10:04”. The last number ‘0’ became ‘4’. I also found that this phenomenon is very common in any number sequence.
The TextFormat is used to print the Value in the series with an specific visual aspect. The numbers in the string represents the number of digits that will be used to print the value, while the character '.' is used to separate the integer part from the decimal part. Other characters such as ':' will be printed as-is.
For example, note the difference between the following codes:

Code: Select all

TChart1.AddSeries scNumericGauge  
TChart1.Series(0).asNumericGauge.Value = 25.76
TChart1.Series(0).ValueFormat = "0.000"
Here we are printing the value forcing three decimals after the "coma". Result: 25.760.

Code: Select all

TChart1.AddSeries scNumericGauge  
TChart1.Series(0).asNumericGauge.Value = 25.76
TChart1.Series(0).ValueFormat = "0:000"
Here we are forcing to print the value only with integer part (there is no coma) so it will be rounded. And we are printing the value forcing four digits and with a "strange" character between some of the characters. Result: 0:026

Gobing wrote:In “Polar” or “Point” series, I want to know whether the return value is the index of new generated point for the function:
int nIndex = m_TeeChart.Series(0).GetAsPolar().AddPolar()
But I found that, the collection of “nIndex” had several repeated values, when using a loop to generate several points. So I doubted the return value of the function mentioned before is not the index.
Point series: It seems to work fine here with the following code:

Code: Select all

Private Sub Command1_Click()
  TChart1.Header.Text.Text = Str(TChart1.Series(0).Add(Rnd * 1000, "", clTeeColor))
End Sub

Private Sub Form_Load()  
  TChart1.AddSeries scPoint
End Sub
Polar series: The problem here is the order. Each time you add a point to this series, the value list is reordered by angle reassigning the indexes. That's why this code returns non sequential numbers, but the correct index assigned in the value list for the entered new point:

Code: Select all

Private Sub Command1_Click()
  TChart1.Header.Text.Text = Str(TChart1.Series(0).asPolar.AddPolar(Rnd * 360, Rnd * 1000, "", clTeeColor))
End Sub

Private Sub Form_Load()
  TChart1.AddSeries scPolar
End Sub
If you want you could force not to do this reorder process with this:

Code: Select all

TChart1.Series(0).XValues.Order = loNone
Gobing wrote:I also want to know how to get the index of the specified point in a series?
Maybe I answered this with the answers above. If you want to retrieve the point index (ValueIndex) in an other situation, please, try to specify more in what context are you trying to do that.
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

Gobing
Newbie
Newbie
Posts: 6
Joined: Fri Jan 11, 2008 12:00 am
Location: Chengdu City, Sichuan Province, PRC
Contact:

Re: Dear Support, I have some troubles

Post by Gobing » Thu Jun 11, 2009 3:12 pm

I want to use the “Numeric Gauge” series to implement the digital display of time with the format “hour : minute : second”. How can I do that?

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

Re: Dear Support, I have some troubles

Post by Yeray » Fri Jun 12, 2009 10:36 am

Hi Gobing,

Here is an example:

Code: Select all

  TChart1.AddSeries scNumericGauge
  TChart1.Series(0).asNumericGauge.Value = Int(Format$(Now, "hmmss"))
  TChart1.Series(0).ValueFormat = "0:00:00"
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

Gobing
Newbie
Newbie
Posts: 6
Joined: Fri Jan 11, 2008 12:00 am
Location: Chengdu City, Sichuan Province, PRC
Contact:

Re: Dear Support, I have some troubles

Post by Gobing » Sat Jun 13, 2009 5:46 pm

Thank you for your help, sir. I’ve already resolved the problems mentioned above. To the “Numerical Gauge” series, I know how to change the palette property from “LCD(default)” to “LED” easily, just using the static edit dialog provided by the TeeChart Control. I try my best , but still could not find a method to change the palette property in my program dynamically. Could you help me, again :D ?

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

Re: Dear Support, I have some troubles

Post by Yeray » Mon Jun 15, 2009 9:44 am

Hi Gobing,

Yes, the possibility to assign palettes for Gauges at design time is an enhancement already present on the wish list to be implemented in future releases (TA05012741). I've incremented its priority as several users asked for this feature.
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