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, I understand that we can specify the LineStyle in the SplineSeries in the Chart control. For example:
But what I want to do is to allow the user to configure the thickness of the line. I wonder if there's a good way of setting the thickness through binding so that I can change the line size dynamically. I tried a few things. With some setup, the code "<Setter Property="StrokeThickness" Value="{Binding DataContext.CurveSize}" />" could work for the SplineSeries. However, the legend does not pick that up. Any advice? Thanks, Sean |
|
|
Hi Sean, Great that you got it working for the series. For the legend, I would recommend trying to set the LegendIconTemplate property of the series. This will allow you to customize the legend icon to include a binding like what you did with the series. Rather than binding through the DataContext though, you'd bind through the DataSeries property on the LegendItem (That the template will get applied to). The DataSeries on the LegendItem is the same as the DataContext on the series. Hope that helps, let me know if you have any problems or questions. -Jason Fauchelle |
|
|
Hi Jason, Thank you for the advice. I found your default LegendIconTemplate from your source code and made some changes to make a new template. Then I used this custom template and it worked. But it comes to my next question. The series title in the legend does not work so well. It always shows "Series 1, Series 2, etc." once I refresh my DataSeries binding. My DataSeries Title is bound to my view model's Title. Thanks, Sean |
|
|
Hi Sean, Unfortunately I have not been able to reproduce this problem at my end. Could you please provide a simple repro project so that I can look into this further. -Jason Fauchelle |
|