Hi,
I have a couple of issues with the Axis labels where the label text is long. The chart axis will extend to the length of the longest label by measuring the text length and setting the surrounding panels height/width accordingly. I would like to limit the size of the axis so when presented in say a small dashboard pane the axis does not take up all the available space.
I have tried a couple of things, bit not found the perfect solution as yet.
1) If I truncate the label values prior to data binding this works fine and the labels are truncated, but I have no way of showing the full label name as a tooltip.
2) If I pass through the full label name and then use a custom textblock control to truncate the label text whilst displaying the full name as a tooltip, the chart still renders the panel at the width of the longest label, even though the controls within the panel are now smaller due to the text truncation.
Any ideas or suggestions on how I can combine these two approaches to give me truncated axis labels with full tooltips would be much appreciated.
Regards,
Chris
Hello,
Can you try setting the XamWebChart width/height? This should limit the size of the chart and not let it spread in all of the available area. Also the WebChart should truncate your long labels and at the same time - let you use the full labels as tooltips.
Boyan
Hi Boyan,
Setting the width and height is not an option as the charts are contained within a XamTileView and the whole UI is sized dynamically to fit the size of the users browser. With a 6 tile dashboard for example, the minimized tiles will only show the axis labels and no chart at all, which is not great from a usability perspective.
Anything else you can suggest?
What if you set the width dynamically as well? I haven't used xamWebChart that much so correct me if I'm wrong. So when you display the chart in a big space, you could allow more width to the labels as well but when displaying the chart in the dashboard, you could set the width to something smaller? Would this work for you?
Hi anttisimonen,
I'm not sure I quite understand what your proposed solution is here? I have no way of knowing how the big the chart will be as the UI and the dashboards size dynamically. The user controls the template for the dashboard, which could have any number of tiles, laid out in different formats.
If you have some sample code to implement this solution that would be appreciated.
Control.ActualWidth will tell you how big something is so you could apply some simple calculation to calculate the width of the labels. You would also need some event handler when the size of your UI changes to implement this solution.
I don't have any sample code right now but I think this could work?