Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
Xamarin legend without wrapping
posted

Hi all.  I'm using XamDataChart with a legend. I only have two series and want them to appear side-by-side rather than one on top of the other.  I saw an example using WPF in the forums. Is there a way to do it in Xamarin?

To be clear, right now it shows as 

[] Series one

[] Series two

I want to appear as 

[] Series one    [] Series two

  • 34810
    Offline posted

    Hello Eric,

    I have been investigating into your query in this case, and the reason this is doable in WPF at the moment is because there is an Orientation property on the Legend element in WPF. This has not yet been developed in Xamarin, and as such, the Legend in Xamarin only currently supports vertical-oriented items.

    With that said, if you only have two series, you could likely create a makeshift “horizontal legend” by utilizing a StackLayout with its Orientation set to “Horizontal” and then you would draw your own custom legend badges and captions.

    If you would like to make your want for the Horizontal legend orientation known to our product management teams, I would recommend suggesting a new product idea for this at our Xamarin.Forms Ideas Site, here. I believe this feature is likely on its way as it exists in WPF, but this will allow you to be in communication with our product management teams who plan and prioritize upcoming features based on community and user feedback.

    Please let me know if you have any other questions or concerns on this matter.