-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Realtime changes on PieChart #47
Comments
You don't need to raise property changed event, Live charts should detect automatically the changes, there is actually one exmaple included in test project, you can clone the repo to see it, or watch it here: XAML https://github.com/beto-rodriguez/Live-Charts/blob/master/ChartsTest/Pie%20Examples/MvvmPie.xaml Code Behind https://github.com/beto-rodriguez/Live-Charts/blob/master/ChartsTest/Pie%20Examples/MvvmPie.xaml.cs Hope it helps, if this does not solves your issue please let me know. |
Forgot to mention that
|
If you are editing the existing collection, you don't need to raise PropertyChanged. If you are reassigning the property, you do, and the control needs to respond to it to redraw. Probably just needs a handler in the dependency property. |
it already has a handler in the dependency property. |
I will try to force this bug, can you please show me some parts of your code, So it can be easier for me? |
public ObservableCollection Spectrum Modification happens 1 time per second: Spectrum.Clear(); |
Can you say smth about my 1st question regarding redrawing from initial state? |
the easiest solution, since you are updating the chart each second should be to disable animations, Set the DisableAnimation Property to ttue in your Pie Chart, right now pie chart only support full redraw animation, to support animation that starts from current state it is necesary to do an important improvements to PieSerie class, I will open a new issue to add this in a future, by now disable animations please. |
Beto, I've found 1 more problem.
updates don't come. but if I bind like this:
and manually do in viewmodel:
where PropSeries is and ObservableCollection then piechart will be updating on collection Obj.Prop changes. Please take a look |
@ruzovvo I will take a look, it seems that the handler is not beeing attached if you initialize it with XAML, I will take a look and let you know as soon as possible, Thanks for reporting |
ruzovvo do you still have the code for realtime pi chart? |
Hi, I'm trying to use PieChart and I set
PrimaryValues="{Binding VM.Obj.Prop, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
VM.Obj.Prop is a property:
public List Prop
{
get {return _prop;}
set {
_prop = value;
RaisePropertyChanged(() => Prop)
}
}
So in RaisePropertyChanged() I generate PropertyChanged event but chart doesn't change. only If I resize the window it will be redrawn.
Am I doing everything right or I miss smth?
The text was updated successfully, but these errors were encountered: