Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Chart Control
  New Posts New Posts RSS Feed - Chart reset problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Chart reset problem

 Post Reply Post Reply
Author
Message
sword warrior View Drop Down
Newbie
Newbie
Avatar

Joined: 19 May 2017
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote sword warrior Quote  Post ReplyReply Direct Link To This Post Topic: Chart reset problem
    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?

Back to Top
wrecks View Drop Down
Groupie
Groupie


Joined: 14 July 2015
Status: Offline
Points: 42
Post Options Post Options   Thanks (1) Thanks(1)   Quote wrecks Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2017 at 10:51am
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.