Skip to content

SP4 WinForms: How to use multiple axes after Clear() #3035

Answered by KroMignon
CBrauer asked this question in Questions
Discussion options

You must be logged in to vote

Hi @CBrauer, I think I understand what's going wrong.

First you should understand that the drawing of the graphic is only done after calling Refresh(), there is no need to call it after clearing the plottables list. plottables means all graphical items in you graph: scatter plots, annotations, crosshair, etc. But not the axis.
If you add a new axe to the graph, it will be there until you remove it!

In your code, each time DrawChart() is called, a new axe is added to the graph, but it is never removed.
You could change your code to remember the added axis and only add it once, or remove all added axes before adding the new one.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Lelick-PMR
Comment options

@swharden
Comment options

Answer selected by swharden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG unexpected behavior
4 participants
Converted from issue

This discussion was converted from issue #3017 on November 29, 2023 13:25.