Change Dynamic control properties at run time

J

jaawaad

I'm creating webcharts control dynamically based on user input as to
how many charts they would like to see. I'm running into problem as to
how to set properties for those charts at run time so they behave and
look all the same.

Creating dynamic chart code looks something like this....

/////////////////////////////////////////////////////////////////////////////////
Sub CreateChartControl(ByVal sender As Object, ByVal e As EventArgs)
Dim ds1 As DataSet = CreateDataSet()
Dim charttest As ColumnChart = New ColumnChart

For Each row As DataRow In ds1.Tables(0).Rows
charttest.Data.Add(New ChartPoint(row("LNAME").ToString,
CType(row _

("AGE"), Integer)))
Next

Dim z As Integer

For z = 1 To 3
ReDim Preserve mycharts(z)
mycharts(z) = New ChartControl
form1.Controls.Add(mycharts(z))
mycharts(z).Visible = True
mycharts(z).Charts.Add(charttest)
mycharts(z).RedrawChart()
Next z
End Sub

///////////////////////////////////////////////////////////////////////

Is there a way to call a routine from FOR loop to format each chart
control and set the properties.

Here are some chartcontrol properties i would like to change at run
time...

<web:ChartControl Runat="server" ID="chartControl1"
ChartPadding="30"
BottomChartPadding="20"
TopPadding="20"
Padding="20" Width="848px" Height="438px"
BorderStyle="outset" GridLines="Both"
Legend-Position="Bottom" Legend-Width="30">
<Background Type="LinearGradient"
Color="#C0FFC0"
EndPoint="900, 900"
LinearGradientMode="BackwardDiagonal"
/>
<Border Color="102, 153, 255" />
<ChartTitle Text="Web Chart Example"
Font="Tahoma, 12pt,
style=Bold" ForeColor="White"

StringFormat="Center,Near,Character,LineLimit" />
</web:ChartControl>

Thanks,
Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top