PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Oct 14, 2019 5:47 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Oct 15, 2016 9:09 am 

Joined: Mon Aug 22, 2011 2:52 pm
Posts: 6
Good day,

I have a problem with text in the XAxis being too big to fit. The problem is that I cannot decrease the text length as these are product names. Please see the current chart at https://www.dropbox.com/s/uksdyhb7dffl0pj/Capture.JPG?dl=0

I would like to either wrap the text to fit on multiple lines or rotate the text 90 degrees or 45 degrees.

How can this be done using MigraDoc?

The code I have at this stage is as follows (in C#):

Chart chart = new Chart();
        chart.Format.Alignment = ParagraphAlignment.Center;
        chart.Left = 0;
        chart.Width = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(24);
        chart.Height = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(12);
        Series series = chart.SeriesCollection.AddSeries();
        series.ChartType = ChartType.Column2D;
        series.FillFormat.Color = Color.FromCmyk(58, 32, 0, 26);
        series.LineFormat.Color = Color.FromCmyk(58, 32, 0, 26);
        XSeries xseries = chart.XValues.AddXSeries();
        chart.XAxis.MajorTickMark = TickMarkType.Outside;
        chart.YAxis.MajorTickMark = TickMarkType.Outside;
        chart.YAxis.HasMajorGridlines = true;
        chart.PlotArea.LineFormat.Color = Colors.DarkGray;
        chart.PlotArea.LineFormat.Width = 1;
        chart.WrapFormat.DistanceLeft = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(0.2);
        chart.WrapFormat.DistanceTop = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(6.6);
        chart.WrapFormat.Style = WrapStyle.Through;

Thank you very much

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 340 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group