Chart reset problem |
Post Reply |
Author | |
sword warrior
Newbie Joined: 19 May 2017 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 19 May 2017 at 4:05am |
Hi.
I'm a beginner of VB.net and tried to build a line chart. Every time I run the code,it seems that chartcontrol doesn't refresh itself,just keep print the title.Here's my code: Public Sub ChartControl1_Initialize() Dim Series As ChartSeries Set Series = ChartControl1.Content.Series.Add("New York") ... ChartControl1.Content.Titles.Add "Population by U.S. State" ChartControl1.Content.Legend.Visible = True ... End Sub And if I run the program 5 times,it looks like: Population by U.S. State Population by U.S. State Population by U.S. State Population by U.S. State Population by U.S. State [chart] Is there any code to reset the chartcontrol?Or just because I wrote the code in a wrong way? |
|
wrecks
Groupie Joined: 14 July 2015 Status: Offline Points: 42 |
Post Options
Thanks(1)
|
Use
ChartControl1.Content.Titles.DeleteAll before you ChartControl1.Content.Titles.Add Or, you might be better off just deleting the entire chart each time you start again.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |