Hi all,
We use MVVM in our application and use XamDataChart to display data, We face following issues, Can anybody help me with sample application ?
Hello elinder,
Thank you for your post!
1. The Numeric Y-Axis in the XamDataChart has a MaximumValue and MinimumValue property, both of which can be bound to a property in your ViewModel. If you would like to set these, I would recommend investigating the collection you have bound to the series in that chart. If you keep track of the minimum and maximum values to be plotted, you can set these values to a property in your ViewModel, and bind them to the YAxis. Alternatively, you can leave these properties blank and the chart will determine the Y-Axis minimum and maximum values based on your data source.
2. To achieve this, I would recommend that you use either the ItemTooltipLayer or the CategoryTooltipLayer of the XamDataChart. The ItemTooltipLayer is demonstrated in the attached sample.
3. To achieve this, I recommend writing a style for your series. In this style, you can define a LegendItemTemplate. Then, I would recommend adding a Trigger to that same style, which targets the IsMouseOver property when it is true. When this trigger is hit, you can set the Thickness value of the series, and also set the LegendItemTemplate to have bold font.
I have attached a sample application to demonstrate the three recommendations above.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks Andrew,
Your provided solution is great, but we have little issue when we set Min and Max values of YAxis.
Regarding your first requirement to have the XAxis inside of the chart when YAxis values are below 0, there are two properties that you must set on the CategoryXAxis. These properties are CrossingAxis and CrossingValue. In this case, the CrossingAxis would be the Numeric Y Axis, and the CrossingValue would be 0. I also see that you have set the Numeric Y Axis' MinimumValue property to 0. You will want to remove this, or set it to something lower to get the negative values to show up in your chart.
Regarding your other requirements, I am unsure of the behavior you are seeing with the RefreshCompleted event being handled in your chart. Also, I am not entirely sure what you are asking regarding the ColumnSeries chart, as it appears that the Minimum and Maximum values are bound in the Numeric Y Axis correctly. Could you please provide some more detail on what requirements you are looking to fulfill with these points?
Thanks Andrew for your great support,
Hi Andrew,
Thank you so much, your provided solution solved my problem.
I have reproduced this issue you are seeing, but it does not appear that the issue is being caused by the RefreshCompleted event handler. It appears to be caused by the end of the SearchHorizontalAxisCallback when you call the dependencyObject.RenderTransform = new TranslateTransform(0.0, -axisHeightAdjustment);
To prove this, consider removing the - from the -axisHeightAdjustment in your project. You will see the labels again, albeit they will be moved up quite a bit. This leads me to believe that what was happening is that the labels were being moved off of the screen, rather than being directly affected by the RefreshCompleted event handler.
I am unsure of what you mean by the Minimum and Maximum values not being bound correctly when the RefreshCompleted event is there though. When I run your sample project, it appears that those values are bound correctly. Could you please provide some more detail on the incorrect functionality you are seeing with the Numeric Y Axis' Maximum and Minimum value binding?