To format money values+legends+regional options (local) ???

TeeChart for ActiveX, COM and ASP
Post Reply
Newbie
Newbie
Posts: 3
Joined: Wed Sep 15, 2004 4:00 am
Contact:

To format money values+legends+regional options (local) ???

Post by » Thu Jan 26, 2006 9:34 am

Hello,

To format money values in the legends by respecting the formatting of the regional options ?

Starting from a page ASP and vbScript how to force TChart (V7.0) so that it formate in the legends of the money values by respecting the parameters of regional options of Windows?

US format : 1,000,000.00
French format : 1 000 000,00

I tried to pass the values by using the vbScript instruction formatnumber () :

Example:


xValue = 1000000
xLib = "my value"
xColor = RGB (71,250,52)

Set Chart = CreateObject ("TeeChart.TChart")

Chart .AddSeries (X)

Chart.Series (0) .Add formatnumber (xValue, 2), xLib, xColor


but does that cause a TChart error!? TChart does not seem by supporting the preformatting of the values.
There is well a Legend.TextStyle property but it is impossible to act on the presentation of the values themselves by respecting the configured options of the regional parameters!!!

You could indicate the procedure to be followed to me to force TChart to use the regional parameters.

Cordially,

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 26, 2006 9:59 am

Hello,

Have you tried using OnGetLegendText event and use its LabelText string paramter and format it?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Newbie
Newbie
Posts: 3
Joined: Wed Sep 15, 2004 4:00 am
Contact:

Post by » Thu Jan 26, 2006 10:11 am

I found the property .ValueFormat but that does not seem to function???
...

xValue = 1000000
xLib = "my been worth"
xColor = RGB (71,250,52)

Set Chart = CreateObject ("TeeChart.TChart")

Chart.AddSeries (X)

Chart.Series (0) .Add xValue, xLib, xColor
Chart.Series (0) .ValueFormat = "#,##0.00"

But does that always cause a TChart error !? :cry: Is there another thing to add so that that can function ?

Cordially,

Newbie
Newbie
Posts: 3
Joined: Wed Sep 15, 2004 4:00 am
Contact:

Post by » Thu Jan 26, 2006 10:26 am

Hello Narcís !

Sorry but the OnGetLegendText event is usable only in VB not in vbScript in a ASP page as that is indicated in the help file of TChart:

Private Sub TChart1_OnGetLegendText (ByVal LegendStyle Have Long, ByVal ValueIndex Have Long, LegendText Have String)

....

...

End Sub
How do you make to use it in a ASP page ???

Cordially,

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jan 30, 2006 7:56 am

Hi,

the events of all ActiveX Controls cannot be called from an ASP page run
server-side as you've seen . If you wish to change the text of the legend then you will have to either:
1. Place a TeeChart object on the client-side browser and run OnGetLegendText() the event client-side.
2. House the TeeChart object in a VB UserControl and run OnGetLegendText() from there - there is an example of this in the ASP examples called "Why script in ASP?"

Post Reply