Nevron Forum

chart border hide data point

https://www.nevron.com/Forum/Topic8274.aspx

By Jeremy Courbat - Wednesday, October 30, 2013

Hi again,

(Yeah I know it's my second topic today)

I have another problem.

I try to do a StepLine graph with 2 Y value possible 0 or 1. Primary Y axis is displayed with a margin, primary X axis is not visible.

I work good except when the value is 0 the border of graph area hide the value. In the 1st picture, the border width is 1 and the line width is 2 so we can see a bit of the line but in picture 2 the line width is 1 so we can't see it.

I have a work around who consist in setting Y axis range with -0.01 to 1 but it's not a good solution and we can see a little bit of axis under the 0 tick what is not beautiful.

I can keep it like this but if a better solution exist, I take it.


Thanks to all the people who will help me.
By Nevron Support - Thursday, October 31, 2013

Hi Jeremy,

Are you sure the x axis not visible? We tested with the following code and everything was working Ok (there is not overdraw from the chart back wall on the series):

   NChart chart = nChartControl1.Charts[0];

   NStepLineSeries stepLine = new NStepLineSeries();

   stepLine.BorderStyle.Color = Color.Red;
   stepLine.DataLabelStyle.Visible = false;

   for (int i = 0; i < 10; i++)
   {
    stepLine.Values.Add(i % 2);
   }

   chart.Series.Add(stepLine);

   chart.Axis(StandardAxis.PrimaryX).Visible = false;

By Jeremy Courbat - Thursday, October 31, 2013

Hi,

Thanks for your reply.

After a bit more test, I try without Xvalues and it works and if I reactivate XValues, it fail again.
By Jeremy Courbat - Friday, November 8, 2013

I make more test with that problem.

I make one graph with 4 Y axis with anchor alongside axis. (I don't know if it's understandable, but see the attachment)

In the attachment we can see the values at 0 are half hidden by something. (With standard colouration it's the same problem)

The work around with the -0.01 value work there too.

So what is the "something" and how that can be corrected?


Thank you in advance.
By Nevron Support - Monday, November 11, 2013

Hi Jeremy,

Please submit an application that replicates the problem for further review. We tested with the following code and were not able to replicate this problem:

   NChart chart = nChartControl1.Charts[0];

   chart.Axis(StandardAxis.PrimaryX).Visible = false;

   NStepLineSeries stepline = new NStepLineSeries();
   chart.Series.Add(stepline);

   stepline.Values.Add(10);
   stepline.Values.Add(20);
   stepline.Values.Add(30);
   stepline.Values.Add(10);
   stepline.BorderStyle.Color = Color.Orange;

   chart.Wall(ChartWallType.Back).VisibilityMode = WallVisibilityMode.Hidden;

   nChartControl1.BackgroundStyle.FillStyle = new NColorFillStyle(Color.Black);

By Jeremy Courbat - Tuesday, November 12, 2013

While I was making an example, I found the problem.

In x axis I have a date time scale with a paging view with the following code:

' X axis
Dim dateTimeScale As NDateTimeScaleConfigurator = New NDateTimeScaleConfigurator
M_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = dateTimeScale

' configure the x axis to use date time paging
StartDate = DateAdd(DateInterval.Second, -10, Now())
DateTimePagingView = New NDateTimeAxisPagingView(StartDate, New NDateTimeSpan(120, NDateTimeUnit.Second))
DateTimePagingView.Enabled = True
M_Chart.Axis(StandardAxis.PrimaryX).PagingView = DateTimePagingView
M_Chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = True

When I activate the paging view, the problem occur, when I disable it, it work fine.

In the attachment you will find a demo with a checkbox which disable the paging view.

I hope you will find the problem.
By Nevron Support - Tuesday, November 12, 2013

Hi Jeremy,

When the axis uses paging it will also automatically apply clip to the plot area - it looks that in this case the pixels covered by the step line are also clipped. To work around this you can consider to extend the y axis area using a view range inflate - check out the following example:

All Examples\Axes\General\View Range Inflate

You need to apply an absolute inflate to the axis - for example one or two point inflate should do the job...

By Jeremy Courbat - Friday, November 15, 2013

Hi,

I tested your solution and it works just like mine, it's, in fact, a bit more "clean" so I will use it.

So it looks like I found a microscopic bug.

Thanks a lot for your answers.