|
Not getting proper result |
Posted by Rajesh on Feb-10-2011 19:06 |
|
Hi,
when I give the data and labels to create the chart, for the whole string it cosider as a only one word and returns chart.
e.g. when I give the labels as labels = Array(City1,City2,City3,City4,City1)
it works fine but when I give the labels as
=> cities comes from the database which are same values as above.
labels = Array(cities) it wont work. it considers City1.....City5 as a City1 only.
I am not sure what may be the issue. Please advice.
Thanks |
Re: Not getting proper result |
Posted by Peter Kwan on Feb-11-2011 02:18 |
|
Hi Rajesh,
In VB/VBScript syntax, it is not possible for Array(cities) to contain the same value as Array(City1,City2,City3,City4,City1), or cities to contain the same value as six separate values City1,City2,City3,City4,City1. For more details, please refer to Microsoft documentation on VB/VBScript.
For your case, I suspect your cities contain a text string "City1,City2,City3,City4,City1". So your code effectively equivalent to:
labels = Array("City1,City2,City3,City4,City1")
Not that the above, which contains one long text string, is different from Array(City1,City2,City3,City4,City1), which contains six different text strings.
To split one long text string into an array, the VB/VBScript function is "Split". You may refer Microsoft documentation for details:
http://msdn.microsoft.com/en-us/library/0764e5w5(VS.85).aspx
For example:
labels = Split(cities, ",")
Hope this can help.
Regards
Peter Kwan |
|