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
|
Hi Jason, I updated to the latest version of WPF Elements and was going to try the changes you made relating to my other post, but ran across a new problem with something that I think had been working fine. I am making scatter plot with a custom DataLabelStyle that binds to the LabelContent property of DataPoint. I set the LabelBinding property on the series. What I am seeing is that often some of the labels do not get their content, and show up as empty. It seems more likely to occur with more data points and series, so it may have to do with timing of the chart updating relative to bindings updating, but that is just a theory. Maybe I am making some mistake. I attached a demonstration project that lets you remake the chart with varying numbers of points and series, so you can observe the occurrence of empty labels. One further thought--if the LabelContent is null for whatever reason, I think there should be a way to suppress the label, rather than showing an empty label. Sometimes it might be desirable to label only some points, and this would provide an good way to do so. I guess the problem is that when you are making the label you have no way of knowing whether the label template will be binding to the LabelContent property. Perhaps a bool property of the data series where true true indicates to skip labels where the LabelContent property of the DataPoint is null? Thanks Peter |
|
|
Hello Peter Looks like the demo you mentioned has not been attached. Jason Fauchelle |
|
|
I'll try again--Peter |
|
|
I'll try again--Peter |
|
|
Hello Peter Looks like the repro project didn't attach properly. I think I have been able to reproduce what you have described though, and I've fixed the bug that I found. This fix will be available in the next nightly build. If this did not fully solve the problem, let me know and try attach the project again, or send it to jason@mindscape.co.nz. As for hiding labels that have no content, you should be able to do this using a trigger in the style to see if the content is no content. I was able to achieve this with the following trigger:
"Display" is the text block that displays the label content. If the label content is null, the Text property gets set to the empty string. The only problem with this approach is that you can not hide the line if you are using ShowLabelLines. Jason Fauchelle |
|
|
Note: We have resolved the file attachment issue. It was a configuration issue with our server. You don't need to send it through now. John-Daniel |
|
|
Hi Jason, Your fix seems to have resolved the problem. Thanks! As for hiding the empty labels, I am sure your suggestion will work fine. It does seem a little inefficient to create possibly many labels just to hide them. I guess that is the WPF way, and it probably won't be noticable. I started programming in the 1970s in assembly language and remember when I used to count bytes and clock cycles to figure out the most efficient way to do something, because it mattered. Times have changed! Peter |
|
|
Hello Peter Indeed this isn't the most efficient way. I've noted this down as an area that can be improved. Jason Fauchelle |
|