This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hey, as I want to use this weekend to try around with Scatter Charts from WPF Elements, I will probably have a few questions. Please forgive me if some question might be trivially for WPF and C# experienced users, as I'm quite new to it. But of course I will try to keep out general questions and stick close to WPF Elements related stuff. Here are my questions:
I appreciate any help I can get! regards josch |
|
|
Hi, even though I have not solved the other problems yet, I got another (small) question: 4) How to rebuild the Chart when I've manipulated the DataSeries at runtime? As the methods Rebuild or BuildChartCore are protected, I'm not able to call them from outside. - Update: Got it partially by just setting the ItemsSource of the ScatterSeries again. But when I switch back to the first ItemSource (only Y-values changed), the grid is messed up as you can see on the image. - Update 2: FIXED BY THE NIGHTLY BUILD! PS: There you can see also issue number 2... (the splitted icon) And another question came up: 5) How to set the method which is called by the DataPoint.IsSelectedChanged Event? I've already tried to set it with an EventSetter in the style for DataPoints but as IsSelectedChanged is no RoutedEvent, it doesn't work. josch |
|
|
Hello Josch Great to see you've resolved a lot of your questions. Here are solutions to your remaining questions: 2) In this scenario, it is possible to set the min and max values of the axis manually by setting them to be the Ticks value of a DateTime. In code, create a new DateTime object of what you want the minimum of the X axis to be. Then set the Minimum of the X axis to be the Ticks value of this DateTime. If you find this to be inconvenient to achieve this effect, let me know and I'll look into providing some kind of option that includes a margin on the axis. 4) Although you have a solution to this, here is some feedback: What manipulations are you making to the DataSeries? If you are modifying the items source (Adding/removing items), then it's best to use an ObservableCollection to hold your data. The Chart will listen to changes made to the ObservableCollection and automatically rebuild the chart. This may be more convenient than setting the ItemsSource property. On the other hand, if you are setting properties on the ScatterSeries that you would expect to cause the chart to be rebuilt, let me know what these properties are as this is probably a bug. 5) Rather than listening to IsSelectedChanged on each data point, you can listen to the SelectedDataPointChanged event on the ScatterSeries. In the event handler, you can get the ScatterSeries that raised the event, then get the SelectedDataPoint property to know which data point was selected. Let me know if you need help with this. If you have any other questions, let me know and I'll help you out. Jason Fauchelle |
|
|
Hey Jason, Thanks for advice. I didn't try it right now, but will do later. But an additional info to 5): I already tried it with IsSelectedChanged, but can only get the latest selected DataPoint. (Or do I miss something?) I need every datapoint whose selection has changed, even if it got just deselected. I'm using multiple selection mode and want to have full control of which datapoints are selected or just got selected/deselected. And one more question: 6) How to make the Axis Sliders (for zooming) work with Touch events? I know I have just to register the event to it, but I don't know how to access the Sliders from code. Update: I don't mean the scroll slider, I mean the sliders to do the zoom. They are not dragable with the touch input (finger). Had the some problem with a normal GridSplitter and fixed it like that:
But as I said, don't know how to make it with these two zoom sliders of each axis. Thank you very much! josch |
|
|
Hello Josch 5) I have added a RoutedEvent to the DataPoint class called IsSelectedChangedEvent. This is registered to the IsSelectedChanged event handler which means you can now use an EventSetter to listen to this event. This routed event will be available in the next nightly build. Nightly builds are available at around 1200 GMT (about 10 hours from now). You can download nightly builds from here: http://www.mindscapehq.com/products/wpfelements/nightly-builds. The event setter on your data point style would look something like this:
DataPoint_IsSelectedChanged is the event handler in your code behind. 6) I have tested the axis sliders on a touch surface here and it all seems to be working fine. Although the sliders listen to mouse events, .NET translates touch events to mouse events allowing it to work. I'm not sure why it does not work at your end. Could it be that the thumbs are to small to pick up the touch events? I'm interested to know what touch device and operating system you have tried it on. We do not currently expose the slider control from the axis, but for now, you can get the slider instance by looking through the visual tree. Here is a method you can include in your application to find a UI Element of a particular type.
Here is how you would use this method:
The generic type is the type of UI Element you are looking for. In this case you want to find the DualSlider. You pass in the axis that you want to find the slider for. This method should be called after the control has loaded. A good place to put this would be in the Loaded event handler of the application Page or Window. Let me know if you have any questions about this. Jason Fauchelle |
|
|
Hey Jason, thanks again! I will report later, when I've tried it. Just for info: I tested the touch events on a Microsoft Surface, now known as Microsoft PixelSense Update: Worked fine to get the slider, but moving the Start- and EndThumb doesn't work even with the added Eventhandler. Is it possible to address the Start- and EndThumb also? (not just the whole slider element) If you are interested to test the input: http://msdn.microsoft.com/en-us/library/ff727911.aspx And here again to question 2): All my data is from February 5, 2012, so when I'm setting the minimum for testing like:
All data should appear for sure on the right side of the beginning of TimeAxis (X). But I get this: All data points get drawn on X=0 and the beginning time is not the minimum I set. |
|
|
Hello Josch 6) I have now used the Surface 2.0 Input Simulator and have found that the sliders still respond correctly to the simulated touch input. Would you be able to send me your project? With this I will be able to best tell you how to listen to events on each of the thumbs. If possible, I will also try to build this into the slider control so you don't have to set it up yourself. 2) Your project will be very useful for helping you with this question too. I have been able to set the minimum using this approach successfully here, so there may be some settings you are using that I haven't considered. If there is a bug in the control, I will promptly resolve this. To send your project, first remove the bin and obj folders, then zip it up and attach to a forum reply. Alternatively you can send it to jason@mindscape.co.nz Jason Fauchelle |
|
|
Hey Jason, thank you very very much for all your help! Never got such a good support just while using a trial version. The open points weren't necessary any more and the whole project is already finished. It was just for a course in the university, which is finished. Of course I'm still interested in it, but don't want to take more time of yours, as I don't have the budget to buy the full version at the moment. But I will keep mindscape in my mind, maybe I will have the pleasure to work again with your libraries in future. Have a nice day josch |
|
|
Hello Josch Thanks for using our WPF Elements control suite in your project. Your feedback was useful to make some improvements to the library. Feel free to ask more questions any time if you use our software in future projects. Jason Fauchelle |
|