Search code examples
windowschartsuwpresolutionwinrt-xaml-toolkit

UWP WinRTXamlToolkit: Chart labels cut off


I'm using the charts of the WinRTXamlToolkit for an UWP-App.

Using an 720p display or better (e.g. Lumia 640) the chart looks just fine, but using a device with a lower resolution (e.g. Lumia 535 at 960x540), the edges of the chart are cut off. I've already tried to change several variables of the chart like padding, margin, width or height, but the outer parts of the chart remain cut off. Whatsoever: changing the scaling of the lower-resolution-device to 125% solves the problem.

Is there a way, to achieve a non-cut-off-chart, without having to set the scaling in device settings on affected devices? The current behaviour forces users to change their overall resolution-scaling just for this one feature.

Example of a cut-off chart

cut off chart

Example of a "normal" chart

normal chart


Solution

  • Seems like the layout is just unable to fit all the elements so they all get their fair amounts of space and the rest gets clipped off. Of course there's probably some issue with that layout logic of the chart control that might be fixed, but if you want a quick fix - you could set the Width/Height of the chart to fixed values and stuff it in a Viewbox.