PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 11:57 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: Tue Oct 08, 2013 12:11 am 
Offline

Joined: Mon Oct 07, 2013 11:32 pm
Posts: 4
Hello, I have two problems I just cant seem to work past.
#1: I have created a line graph and need to show data labels on some of the plot points. Is this possible? I have not found any way to show a data label anywhere on a line chart.
This is what I tried so far in C#
Code:
var lineSeries = lineChart.SeriesCollection.AddSeries();
            lineSeries.ChartType = ChartType.Line;
            lineSeries.Add(new double[] { 0.43, 2.13, 2.86, 4.62, 7.04, 10.29, 14.76, 20.07, 26.78, 35.98, 47.02, 57.94, 59.85 });
            lineSeries.LineFormat.Color = Colors.Red;
            lineSeries.Name = "4 Year Average";
            lineSeries.HasDataLabel = true;
            lineSeries.DataLabel.CreateValue("38.98");
            lineSeries.DataLabel.Font.Color = Colors.Black;
            lineSeries.DataLabel.Type = DataLabelType.Value;
            lineSeries.DataLabel.Position = DataLabelPosition.InsideBase;

I am able to get this to work with a ColumnChart but LineChart seems to refuse it. Anyone had any luck with this? This is what I need it to look like.
Image

#2 I am setting the YAxis.Title.Caption and have tried changing the YAxis.Title.Orientation = 90; This correctly turns the text the way I want it (vertical), but the high property is still the same as the original text, so it is all squished inside. There is no width or height property to set. How do I do this? This is my code.
Code:
lineChart.YAxis.MajorTickMark = TickMarkType.Outside;
            lineChart.YAxis.Title.Caption = "Inches/Acre";
            lineChart.YAxis.Title.VerticalAlignment = VerticalAlignment.Center;
            lineChart.YAxis.Title.Orientation = 90;
            lineChart.YAxis.Title.Alignment = HorizontalAlignment.Center;
            lineChart.YAxis.HasMajorGridlines = true;

Image


Top
 Profile  
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: No registered users and 153 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