MSchart problem

Illusion

Well-known member
Joined
Aug 7, 2003
Messages
105
Location
Uk
Hi,

I am trying to get MSChart control to work with my data, it works fine if i manually edit the data into it, but I want to beable to give it random data depending on what the user enters into it.
For example, If the user wants temp1, temp2, temp3, temp4 then i need it to create a new object, from what i have seen in the microsoft help.....


Dim Sales(,) As Object = New Object(,) _
{{"cheese spread", "temp1", "temp2", "temp3", "temp4"}, _
{"June", 20, 10, 4, 6}, _
{"July", 10, 8, 20, 5}, _
{"August", 30, 4, 13, 9}, _
{"September", 14, 7, 9, 2}}

chtSales.ChartData = Sales


this works, but im not sure how to make it user defined.. is this possible. or is there an easier way?

Thanks.

Illusion.
 
Just use variables. And if you mean the Object, use the Name property to give each new one a different name.
 
Hi,

Im not sure how...
I have found out that {{}} is a mutlidimensional variant array (or so it says it is) .. It works fine with fixed data, but I need the data to change, I also need it to be a random lenght ... so for example one time I might have

July
August
September

so it would be Chart(,) as object = new object(,) _
{{"Chart", "Data1", "Data2"}, _
{"July", 20, 10}, _
{"August", 20, 10}, _
{"September", 20,10}

this works fine when the chart calls the data
Chart.chartdata = chart

... but as I need different months and maybe more Data1, 2 etc for it....

Is there a way to do this?
 
As far as a flexible size for the variables in the list you can use an ArrayList instead of an object[]. But you may want to use a DataSet for the multidementional part of your list instead.
I would help but I have never used a DataSet.
 
Back
Top