microcharts-dotnet / Microcharts

Create cross-platform (Xamarin, Windows, ...) simple charts.
MIT License
2.03k stars 360 forks source link

[Feature] Rotation Label #335

Open sandydelhoute opened 1 year ago

sandydelhoute commented 1 year ago

I need a rotation label for axe X for barchart

I add two element for implementation rotation. I add enum options in Orientation

RightInclined, LeftInclined,

I change 'else if' to 'switch case' in function DrawLabel present in file drawhelper and i add the code case Orientation.RightInclined: { canvas.Translate(point.X, point.Y - (bounds.Width / 2) + textSize); canvas.RotateDegrees(45); break; } case Orientation.LeftInclined: { canvas.Translate(point.X - bounds.Width / 2 - textSize, point.Y + (bounds.Width / 2) - textSize / 2); canvas.RotateDegrees(-45); break; } example: image

titiBeOne commented 1 year ago

It will be very great to be able to customize the orientation of the label