Replies: 2 comments
-
|
same problem. did you find a solution? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I suspect your solution is not working because you're using As a rule, you should never use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How do I update the data of a
Chart?I'm using MAUI and I have a
ChartViewthat has a renderedChart, but at a later point in time, the data changes.I can't bind the
Entriesof any type ofChart, so I opted to bind theChartView.ChartPropertyand generate a completely new chart, but this method will not clear the canvas before redrawing, it will simply draw an additional copy of the chart somewhere on the canvas, it does in fact seem to attempt to avoid drawing over the previous chart if possible.The canvas is not accessible, so I can't manually erase it.
In the context where the update comes in, I do not know the exact subclass of the current
Chart.Chartitself has noEntriesproperty, so I can't change that.Even if I first change the
ChartView.Charttonull, the canvas is not erased.UPDATE:
Turns out the canvas is only erased when you set the
Charttonull. However when you use MVVM and bindings in MAUI, it won't work well together:nullto clear canvasI tried a different step 2 where I set the
ChartView.Graphtonull, but that doesn't work either.I managed to get it to work when I introduced a delay between 2 and 3, but that's ugly and not guaranteed to work.
Beta Was this translation helpful? Give feedback.
All reactions