Comments (12)
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.
from live-charts.
Forgot to mention that VM.Obj.Prop
should be an observable collection, otherwise it wont update automatically, try instead
public ObservableCollection Prop {get;set;}
from live-charts.
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.
from live-charts.
it already has a handler in the dependency property.
from live-charts.
Hi again. I tried what you've suggested with ObservableCollection. Now it works almost fine. Thank you for it.
But there are still 2 problems I'd like to avoid:
- each redraw is being processed from initial state but not from the previous state of collection
- look at pic attached. After redraw I have artifact numbers left from previous collection state. Sometimes these artifacts are being collected during several redraws so my numbers look like mess. I marked it with arrows
from live-charts.
I will try to force this bug, can you please show me some parts of your code, So it can be easier for me?
from live-charts.
public ObservableCollection Spectrum
{
get { return _spectrum; }
set
{
_spectrum = value;
RaisePropertyChanged(() => Spectrum);
}
}
Modification happens 1 time per second:
Spectrum.Clear();
Spectrum.Add(val1);
Spectrum.Add(val2);
Spectrum.Add(val3);
Spectrum.Add(val3);
from live-charts.
Can you say smth about my 1st question regarding redrawing from initial state?
from live-charts.
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.
from live-charts.
Beto, I've found 1 more problem.
this approach does not work:
<liveCharts:PieChart Name="Spectrum" Grid.Row="0" Grid.Column="0" DisableAnimation="True">
<liveCharts:PieChart.Series>
<liveCharts:PieSeries Title="Maria" PrimaryValues="{Binding Obj.Prop}"
Labels="{Binding Obj.PropDesc}" />
</liveCharts:PieChart.Series>
</liveCharts:PieChart>
updates don't come. but if I bind like this:
<liveCharts:PieChart Name="Spectrum" Grid.Row="0" Grid.Column="0" DisableAnimation="True" Series="{Binding PropSeries}"/>
and manually do in viewmodel:
PropSeries.Add(new PieSeries() { PrimaryValues = Obj.Prop });
where PropSeries is and ObservableCollection then piechart will be updating on collection Obj.Prop changes. Please take a look
from live-charts.
@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
from live-charts.
ruzovvo do you still have the code for realtime pi chart?
from live-charts.
Related Issues (20)
- StackedColumnSeries problem
- Setting Stroke-Color via Mapper in LineSeries not working
- Ошибка нулевого значения координат графика
- Cartesian Chart without "curving" line serie HOT 1
- Document for Geared Live Chart 1.0
- How to add the X axis Label as title while showing the tooltip
- AxisSection when deleting a section (dataLabel = true), the label on the axis remains
- Unable to change background color of GeoMap properly
- Geo Map crashes when app is deployed
- High resolution heatmap -- is it possible? HOT 1
- Transfer License with Team mates
- buy a livechart.geared license
- I have bought Livecharts.Geared. But can't login through Microsoft account HOT 4
- Fill LineSeries below option.
- Add unit inside tooltip?
- Graphical discrep on piechart w/ one slice @ 100%
- Oops
- Problem with the presentation of Constant Change 1, XAML wrong
- By default, some values in the horizontal coordinate display many digits
- Server Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live-charts.