Is there a way to display the chart's trendlines in the legend as well as the series themselves?
Unless I'm mistaken, I'm pretty sure you could just change the series' LegendItemTemplate. It has access to the Series so you should be able to show all the trendline details in there. Something like...
Hello Vasu,
After some research Trendlines in Legend has been determine as a new Product Idea. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI12090148
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.
Doesn't that a performance overhead, creating a new series ? I would love to have this feature built in.
-Vasu
Unfortunately there isn't a built in option for that. The trendline is treated as an annotation on the series rather than a series unto itself. You do have a few options available to you though (apart from a feature request). You can create a second series bound to the same data to act as the trendline, and set the stroke and brush to transparent, so that only the trendline portion shows. You could then use the title of that series to be the title of the trendline in the legend. That would leave the issue of the fact that the legend badge for that series is pulling colors that you just set to transparent. But you can fix this by providing your own LegendItemBadgeTemplate for the trendline series and bind its colors against the trendlinebrush, etc.
Another option you have is to amend the badge for the one series to include indications of both the main colors and the trendline colors and have the title indicate both the series title and the trendline title.
Another option you have, if you don't mind performing the trend calculation yourself is to implement the trendlines as CustomIndicator series, which has an entry in the legend.
Or, you are of course welcome to make a feature request.
-Graham
Hello,
Thank you for your post. I have been looking into it and I suggest you see the sample in the Feature Browser under xamDataChart / Display – Legends / Legend Item Template section, where it is shown how to create a LegendItemBadgeTempalte.
Hope this helps you.