Page 1 of 1

Problems with add Arrays to TChart

Posted: Mon Jul 09, 2007 5:26 am
by 9641080
Hi there, i have the following Problem, i can do the following

objTChart.Add(CType(arrTimes.ToArray(GetType(DateTime)), DateTime()), CType(arrHiValue.ToArray(GetType(Double)), Double()))

i can do
objTChart.add(Date,Double,"Label")

but i cannot do add three Arrays
objTChart.add(arrTimes,arrHiValue,arrTimes.text)

why not. i've got allways error like
Error by the (German) Überladungsauflösung

the third Array is for the Labels in the Bottom Axis

Posted: Mon Jul 09, 2007 9:02 am
by 9348258
Hi Martinx

Could you please send us a simple example project we can run "as-is" to reproduce the issue here?

You can post your files either at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup or at our upload page

please let us know when you have posted the sample project.

Posted: Mon Jul 09, 2007 9:15 am
by Chris
Hello!

Which overload of Series.Add() are you using?

method

Posted: Mon Jul 09, 2007 9:43 am
by 9641080
Hi, i use
.add(x as Date,y as Double , text as String)

Greetings

Posted: Mon Jul 09, 2007 9:44 am
by 9641080
Sorry i mean
but i cannot do add three Arrays
objTChart.add(arrTimes,arrHiValue,arrTimes_text)

Posted: Mon Jul 09, 2007 9:54 am
by Chris
Hello,
Sorry i mean
but i cannot do add three Arrays
objTChart.add(arrTimes,arrHiValue,arrTimes_text)
Ok. I think the problem here is that there is no overload of Series.Add() which takes three Arrays, in which case you will have to iterate through your arrays and add them in using the relevant Series.Add() overload (which is what would happen in any case, internally). We'll look into the possibility of a new Series.Add() overload which takes three arrays.

Posted: Mon Jul 09, 2007 10:26 am
by 9641080
Hi Mr.Ireland
>Ok. I think the problem here is that there is no overload of Series.Add() >which takes three Arrays, in which case you will have to iterate through >your arrays and add them in using the relevant Series.Add() overload

Did you Have an Example what you did mean ?


At the moment i have done the following solution . Please correct me if its not okay

Dim labels As New Steema.TeeChart.Styles.StringList(ds.Tables(0).Rows.Count)





For Each cRow In ds.Tables(0).Rows
dMenge = Convert.ToDouble(GetDBValue(cRow.Item("Value"), "Zahl"))
arrHiValue.Add(Convert.ToDouble(dMenge))
If dMenge > nMaximum Then
nMaximum = dMenge
End If
Dim tDatum As Date
tDatum = Convert.ToDateTime(GetDBValue(cRow.Item("Date"), "DatumUhrzeit"))
sDatum = Format(tDatum, "dd.MM.yy")
sDatum = sDatum & vbCrLf
sDatum = sDatum & Format(tDatum, "HH:mm")

arrTimes.Add(tDatum)
labels.Add(sDatum)
Next
If arrTimes.Count > 0 Then
objTChart.Add(CType(arrTimes.ToArray(GetType(DateTime)), DateTime()), _
CType(arrHiValue.ToArray(GetType(Double)), Double()))
objTChart.Labels = labels
End If



i don't know if correct but it works :)
greetings martin

Posted: Mon Jul 09, 2007 10:36 am
by Chris
Hello,
i don't know if correct but it works
It looks ok to me. If it works, it _is_ correct :D