We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Extra space in between "Y" axis scale and chartarea

Thread ID:

Created:

Updated:

Platform:

Replies:

55419 Jan 30,2007 02:25 AM Feb 2,2007 02:24 AM Windows Forms 6
loading
Tags: Chart
Sathishkumar Kaliavaradhan
Asked On January 30, 2007 02:25 AM

Hi All,

I am adding seperate axis scale for my chart series and also i am allocating location and size by manually

below is my code.

series.YAxis.LocationType = ChartAxisLocationType.Set;
series.YAxis.Location = new PointF(this.chartControl1.PrimaryYAxis.Location.X, this.chartControl1.ChartArea.RenderBounds.Bottom - (count * height));
series.YAxis.AutoSize = false;
series.YAxis.Size = new SizeF(0, height);

but it shows some extra space between "Y" axis sclae and chartArea,

Please reply me,How do i solve this problem ?

I attached my screen shot also.

With Regards
K.Sathishkumar

ChartAxisProblem.zip

Ramya R [Syncfusion]
Replied On January 30, 2007 04:06 AM

Hi Sathishkumar,

Thank You for your interest in Syncfusion products.

To display the axes added by you to the ChartSeries along the location of PrimaryYAxis change the code snippet as shown below ,

series.YAxis.LocationType = ChartAxisLocationType.Set;
series.YAxis.Location = new PointF(this.chartControl1.PrimaryXAxis.Location.X, this.chartControl1.ChartArea.RenderBounds.Bottom - (count * height));
series.YAxis.AutoSize = false;
series.YAxis.Size = new SizeF(0, height);

Let me know if you have any queries.

Thanks & Regards,
Ramya.

Sathishkumar Kaliavaradhan
Replied On January 30, 2007 08:55 AM

Hi Ramya,

I did whatever you suggested in last mail,now there is no space between "Y" axis and chartarea but it drawing some extra line beside the chart axis.

I attached my example code also.

Can you please look into my code then reply as soon as possible.

Thanks and Regards
K.Sathishkumar.

chartAxis.zip

Sathishkumar Kaliavaradhan
Replied On January 31, 2007 12:54 AM

Hi Ramya,

I waiting for your update only...

Can you please give me solutions for my problem.

With Regards
K.Sathishkumar

Administrator [Syncfusion]
Replied On January 31, 2007 05:15 AM

Hi Satishkumar,

Sorry for the inconvenience caused.

I modified the code snippet of SetAxis method as shown below,

private void SetAxis()
{
if (this.chartControl1.Series.Count > 0)
{
this.chartControl1.ChartArea.ChartAreaMargins.Bottom = 30;

axis0.LocationType = ChartAxisLocationType.Set;
axis0.Location = new PointF(this.chartControl1.PrimaryXAxis.Location.X, (this.chartControl1.ChartArea.RenderBounds.Bottom - this.chartControl1.ChartArea.RenderBounds.Height * 2 / 5+20));
axis0.AutoSize = false;
axis0.Size = new SizeF(0, (this.chartControl1.ChartArea.RenderBounds.Height / 3 - this.chartControl1.ChartArea.RenderBounds.Height / 12));

axis1.LocationType = ChartAxisLocationType.Set;
axis1.Location = new PointF(this.chartControl1.PrimaryXAxis.Location.X, (this.chartControl1.ChartArea.RenderBounds.Bottom - this.chartControl1.ChartArea.RenderBounds.Height * 3 / 5-20));
axis1.AutoSize = false;
axis1.Size = new SizeF(0, (this.chartControl1.ChartArea.RenderBounds.Height / 3 - this.chartControl1.ChartArea.RenderBounds.Height / 12));
}
}

I have also attached the modified sample with this post.

Kindly take a look at the code snippet and let me know if you have any queries.

Thanks & Regards,
Ramya.

ChartAxesSample0.zip

Sathishkumar Kaliavaradhan
Replied On January 31, 2007 05:33 AM

Hi Ramya,

Can you please modify the sample such way that chart axis will occupy the full height of chart control.

Waiting for your update...

Thanks and Regards
K.Sathishkumar.

Administrator [Syncfusion]
Replied On February 2, 2007 02:24 AM

Hi Satishkumar,

If your intention is to draw the the secondary Y-axes to occupy the height of the PrimaryYAxis then it can be done by adjusting the size and location of the secondary-Y axes as shown in the code snippet below,

private void SetAxis()
{
if (this.chartControl1.Series.Count > 0)
{
this.chartControl1.ChartArea.ChartAreaMargins.Bottom = 30;
this.chartControl1.ChartArea.ChartAreaMargins.Left = 30;

axis0.LocationType = ChartAxisLocationType.Set;
axis0.Location = new PointF(this.chartControl1.PrimaryXAxis.Location.X, this.chartControl1.PrimaryXAxis.Location.Y);
axis0.AutoSize = false;
axis0.Size = new SizeF(0, this.chartControl1.PrimaryYAxis.Size.Height);
axis1.LocationType = ChartAxisLocationType.Set;
axis1.Location = new PointF(this.chartControl1.PrimaryXAxis.Location.X-40, this.chartControl1.PrimaryXAxis.Location.Y);
axis1.AutoSize = false;
axis1.Size = new SizeF(0, this.chartControl1.PrimaryYAxis.Size.Height);
}
}

In this SetAxis( ) method I have drawn the axis1 to be away from the PrimaryYAxis since both axis0 and axis1 get overlapped as they are of the same height.

I have also attached the modified sample with this post.

Let me know whether this helps you.

Thanks & Regards,
Ramya.


ChartAxesSample1.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;