Hi ,
i want to create a line chart , where i can drag the line using the mouse and modify the graph doing so.
i am using MVVM , so i would like each mouse drag to change my VM data. so i can use it later .
is this supported by XamDatachart ?
if so, can i get a small example or a link ?
Thanks.
Hi Shaul,
You can use a behavior to attach to the line series and in the behavior handle the mouse events required for manipulating the data. In the behavior I detect which item in the line series was clicked and while the user is holding the left mouse button down they can drag the data point up or down to give it a new value.
Take a look at the attached sample and let me know if it helps.
Hi Rob,
Can you give an updated Version of this sample Project wich is compatible with Ultimate for WPF 2018.2?
Sorry for the late reply, but I had to follow up other things in our company....I tried the updated Version and I still get Errors:In MainWindow.xaml at line 24 Position 22 I get an error:
The Tag "Interaction.Behaviors" is not contained in XML-Namespace "http://schemas.microsoft.com/expression/2010/interactivity"
Regards Horst
Hi Horst,
That's probably because you don't have the Expression Blend SDK installed which is fine, there is a Nuget package for it now. I updated the sample to use this package so it should work for you now.
4503.xamDataChart-DragLineSeriesData-18.2.zip
Hi Rob,I have Expression Blend SDK already installed. There must be something else.
FYI: My develepment machine has restricted Access to the net. Thus connecting to Nuget Feeds is currently forbidden. Thus I had to replace the .dll links to the places of my local Installation.
The links all are OK.
might be related to -> stackoverflow
regards Horst
I'm not really sure what the issue could be then if you have all the assemblies required. That stackoverflow issue deals more with using Interaction.Behavior inside a Resource tag which this sample does not do.
I can also see in your screenshot that there are more errors for other objects as well. Have you tried to build the project regardless of those errors? In some cases the XAML designer is known to display errors but the project is still capable of building and running successfully.
You could also try some of the solutions listed here: https://stackoverflow.com/questions/14665713/the-name-does-not-exist-in-the-namespace-error-in-xaml
But if you can still build and run the project regardless of those designer errors then I wouldn't worry about it too much for this sample. The designer isn't useful in this scenario. The important parts are in the behavior itself at how it attaches to the chart series.
thank you for the stackoverflow link. The last entry let me to the solution...
scolling down the list showed an entry that System.Windows,Interactivity was built against .NET 4.5.
The sample Project was built against 4.0 Client. Thus selecting 4.61 as target Framework and rebuilt, solved the Problem.
It is an old sample so I'm not surprised it targets 4.0 but I should have realized what versions of .NET everything was targeting. I'll keep that in mind the next time I need to update older samples. I'm glad you were able to figure it out and resolve it though. Awesome!