PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 3:22 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Background on chart
PostPosted: Thu Feb 25, 2010 10:39 am 
Offline

Joined: Thu Feb 25, 2010 10:25 am
Posts: 8
Hi,
I have a question about the background color, when using PdfSharp.Charting;

For now, I can create a chart.. and my background on the plotarea is oke. This is White.
chart.PlotArea.FillFormat.Color = XColors.White;

But outside the plot area ( where the labels, legend etc etc ) are, I still have the White to Blue (fading) background. How can I remove that / make it transparent??

-----------------------

Also I have another question, how to turn the X labels? Or is it possible to skip some values.

Thanks for answering!
Greets Gerard


Attachments:
File comment: Picture of my problem
Picture.JPG
Picture.JPG [ 54.92 KiB | Viewed 9093 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Thu Feb 25, 2010 12:40 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Hi!

I have no expertise with charts ...

Re: X axis:
The XAxis property has members MinorTick and MajorTick. That should do the trick.
Not sure, but filling the XValues collection could also do the trick.

Re: Background color:
I'm afraid these colours are hard-coded in the ChartFrame class (Draw method).
Search for "XColor.FromArgb(0xFFD0DEEF)" and update the source code as needed.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Thu Feb 25, 2010 1:32 pm 
Offline

Joined: Thu Feb 25, 2010 10:25 am
Posts: 8
Thanks!!,
Background color is fixed!
OLD:
//XLinearGradientBrush brush = new XLinearGradientBrush(chartRect, XColor.FromArgb(0xFFD0DEEF), XColors.White,
// XLinearGradientMode.Vertical);
NEW:
XLinearGradientBrush brush = new XLinearGradientBrush(chartRect, XColor.FromArgb(255,255,255), XColors.White,
XLinearGradientMode.Vertical);

THANKS!!! - OpenSource Rulesz!!
About the Xasis, I have to try ...

But, another question,..
Do you know what the difference is between PdfSharp.Charting.dll & PdfSharp.Charting-WPF.dll. What does WPF?

Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Thu Feb 25, 2010 3:08 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
gerardn wrote:
Do you know what the difference is between PdfSharp.Charting.dll & PdfSharp.Charting-WPF.dll. What does WPF?

They should do the same - but using different implementations (one based on old-fashioned GDI+ code, one based on new-fandangled WPF that comes with .NET Framework 3.5).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Mon Mar 01, 2010 8:25 am 
Offline

Joined: Thu Feb 25, 2010 10:25 am
Posts: 8
Hi,

The ticklabels don't work for me... :(
I put some other data into the graph, but.. I can't remove or reshape / rotate the labels on the xasis...

This is a part of my code:
XSeries xseries = chart.XValues.AddXSeries();
xseries.Add("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N");
chart.XAxis.MajorTick = 100;
chart.XAxis.MinorTick = 10;
chart.XAxis.MajorTickMark = TickMarkType.Inside;

chart.XAxis.Title.Caption = "X-Axis";

In my original, I don't add a serie to the X-Axis.. but I'll did this because its better for seeying differences.
But there is no difference, when I uses the majorTick / minorTick.. the values are still on the same place.

What I originally want to do, is:
* No adding of manually xseries ( but take it from original )
* Skip some xvalues ( on labels only ) display 1 of 500 values
* rotate the values

And another question:
I don't know.. if the y values are around the 0.000005678 .. how to see that on the values, then I see only 0.0

Thanks for answering!


Attachments:
File comment: The small one with some values
screenshot with some values.jpg
screenshot with some values.jpg [ 64.55 KiB | Viewed 9074 times ]
File comment: The big 5000 values

Values to print ( on the y axis )
0.001972454
0.001974298
0.001980285
That are some values in the linechart. I expected a y-axis label from 0.0 / 0.10 / 0.20 .. is tha possible?
etc etc.......

screenshot with 5000 values.jpg
screenshot with 5000 values.jpg [ 12.33 KiB | Viewed 9074 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Wed Mar 03, 2010 8:41 am 
Offline

Joined: Thu Feb 25, 2010 10:25 am
Posts: 8
Please can you answer this question?

Thanks!
Greets Gerard


Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Thu Mar 11, 2010 7:00 am 
Offline

Joined: Thu Feb 25, 2010 10:25 am
Posts: 8
Sorry!!!, Maybe it sounds al little bit like nagging, but has someone a solution for my problem?
I am unfortunately don't know where I should look, so why ...

Thank you very much for answering.
Kind regards, Gerard Nijkamp


Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Tue Mar 16, 2010 1:15 pm 
Offline

Joined: Mon Jan 04, 2010 2:44 pm
Posts: 23
Try multiplying all your numbers by a million.


Top
 Profile  
Reply with quote  
 Post subject: Re: Background on chart
PostPosted: Tue Mar 16, 2010 1:19 pm 
Offline

Joined: Thu Feb 25, 2010 10:25 am
Posts: 8
Thanks!, but is there no other option?

A better one?
And do you know how to skip some x-values??
Thanks for your'e answer!

Greets Gerard


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 322 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