PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Sep 19, 2019 3:38 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Jun 14, 2008 4:35 pm 
Offline

Joined: Sat Apr 12, 2008 8:51 am
Posts: 10
Hi !

I couldn't get tick marks on a horizontal axis (using MigraDoc w/ PdfSharp), after comparing HorizontalXAvisRenderer and VerticalYAxisRenderer, here's the trick :

Changes in PDFsharp\Charting\Charting\PdfSharp.Charting.Renderers\HorizontalXAxisRenderer.cs

inside Draw(), at line 160 after
Code:
      LineFormatRenderer lineFormatRenderer = new LineFormatRenderer(gfx, xari.LineFormat);

add the following
Code:
      LineFormatRenderer minorTickMarkLineFormat = new LineFormatRenderer(gfx, xari.MinorTickMarkLineFormat);
      LineFormatRenderer majorTickMarkLineFormat = new LineFormatRenderer(gfx, xari.MajorTickMarkLineFormat);


then at line 176 replace
Code:
          lineFormatRenderer.DrawLine(points[0], points[1]);

with
Code:
          minorTickMarkLineFormat.DrawLine(points[0], points[1]);


and at line 194 replace
Code:
          lineFormatRenderer.DrawLine(points[0], points[1]);

with
Code:
          majorTickMarkLineFormat.DrawLine(points[0], points[1]);


This work it out for me ;)

Have a nice day !


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 07, 2009 8:06 pm 
Offline

Joined: Wed Jan 07, 2009 6:31 pm
Posts: 3
So i thought maybe your solution would solve my problem.

Nope.

the yaxis minor/major ticks work perfectly but the xaxis majortick is always = 1 and minortick = 0.5. (BTW that's the default set up in HorizontalXAxisRenderer and VerticalXAxisRenderer.)

the process is getting into the loop that I believe is setting the major and minor values but the value isn't changing. There has to be something wrong with the variables used in that loop but I haven't found it yet.

Anyone had any luck fixing this?

Cheers,
Mo


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 25, 2019 10:21 am 
Offline

Joined: Mon Feb 25, 2019 10:17 am
Posts: 1
Having the same Problem and also in the Hello MigraDoc example there are no x-axis tickmarks.
Just wanted to inform readers that this isn't fixed yet.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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