Profile Picture

Labels

Posted By ANDRE SIMOES 12 Years Ago
Author
Message
ANDRE SIMOES
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 9, Visits: 1
Hello, I have 2 questions:

1 - What is the best way to put some labels on a 2D chart like those one in red in my attachment? This red ones I used paint just as an example.\


2 - The horizontal axes, I couldnt find out how to give a better precision, I have only 2 divisions (0,1) but I want more like from -0.2, -0.1 ... 1.0 , 1.2...

Thank you in advance!



Attachments
question.png (56 views, 26.00 KB)
Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Andre,

1 - What is the best way to put some labels on a 2D chart like those one in red in my attachment? This red ones I used paint just as an example.
You can use two approaches:

1.1. Create a point series with invisible data point and add data labels to it:

   NChart chart = nChartControl1.Charts[0];

   NPointSeries point = new NPointSeries();

   point.DataLabelStyle.Format = "<label>";
   point.DataLabelStyle.VertAlign = Nevron.VertAlign.Center;
   point.DataLabelStyle.TextStyle.BackplaneStyle.Visible = false;
   point.DataLabelStyle.TextStyle.StringFormatStyle.HorzAlign = Nevron.HorzAlign.Left;
   point.DataLabelStyle.TextStyle.StringFormatStyle.VertAlign = Nevron.VertAlign.Top;
   point.DataLabelStyle.ArrowLength = new NLength(0);

   point.FillStyle = new NColorFillStyle(Color.Transparent);
   point.BorderStyle.Width = new NLength(0);
   

   point.Values.Add(10);
   point.XValues.Add(10);
   point.Labels.Add("Label 1");

   point.Values.Add(20);
   point.XValues.Add(20);
   point.Labels.Add("Label 2");

   point.Values.Add(30);
   point.XValues.Add(30);
   point.Labels.Add("Label 3");

   chart.Series.Add(point);

1.2. Use custom painting (All Examples\Custom Painting).

2. The horizontal axes, I couldnt find out how to give a better precision, I have only 2 divisions (0,1) but I want more like from -0.2, -0.1 ... 1.0 , 1.2...
Most likely you're using the ordinal scale - you should switch to linear:

NLinearScaleConfigurator xScale = new NLinearScaleConfigurator();
chart.Axis(
StandardAxis.PrimaryX).ScaleConfigurator = xScale;

is has lot's of options for tick step etc, but the default settings should also work fine.

Hope this helps - let us know if you meet any problems.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic