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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multiple Axis Layouts

Thread ID:

Created:

Updated:

Platform:

Replies:

88410 Jul 22,2009 09:09 AM UTC Mar 24,2010 01:17 PM UTC ASP.NET Web Forms (Classic) 8
loading
Tags: Chart
Gary Nicol
Asked On July 22, 2009 09:09 AM UTC

Hi,

Is it possible to control the height of the individual axis when using side-by-side layouts?

I have two Y axes vertically above each other and the height of each axis defaults to 50% of the overall chart height. Ideally I'd like to have the bottom axis occupying 20% of the overall chart height with the top axis taking the remaining 80%.

Best regards,

Gary

Venkata Vijayaraj B [Syncfusion]
Replied On July 22, 2009 10:11 AM UTC

Hi Gary,

Use RealLength property of Axis, to get or set the length of axis.

Code Snippet:

ChartWebControl1.PrimaryXAxis.AutoSize = false;
ChartWebControl1.PrimaryXAxis.RealLength = 100;

ChartAxis secYAxis = new ChartAxis();
secYAxis.AutoSize = false;
secYAxis.RealLength = 150;

please let me know if this meets your requirement.

Regards,
Venkat.

Venkata Vijayaraj B [Syncfusion]
Replied On July 22, 2009 10:13 AM UTC

Hi Gary,

Sorry. In my previous update, I given PrimaryXAxis instead of PrimaryYAxis. Please refer the modified code.

Code Snippet:

ChartWebControl1.PrimaryYAxis.AutoSize = false;
ChartWebControl1.PrimaryYAxis.RealLength = 100;

ChartAxis secYAxis = new ChartAxis();
secYAxis.AutoSize = false;
secYAxis.RealLength = 150;

please let me know if this meets your requirement.

Regards,
Venkat.

Gary Nicol
Replied On July 22, 2009 12:58 PM UTC

Hi Venkat,

That's perfect - many thanks for the prompt response.

Best regards,

Gary

Palak Jain
Replied On March 11, 2010 04:13 PM UTC

I am using Windows Chart control. I tried the above code for resizing the chart axes but it didnot work.

chart1.PrimaryYAxis.AutoSize = false;
chart1.PrimaryYAxis.RealLength = 100;
yaxis.AutoSize = false;
yaxis.RealLength = 150;

Please let me know how to divide the axes lengths unequally.
Also is there a way to make the series and its axes disappear making the other series and axes take up the entire area?
For example I have a Price and Volume chart and I want the volume chart to hide and Price chart to take up the entire chart control.

Venkata Vijayaraj B [Syncfusion]
Replied On March 12, 2010 11:41 AM UTC

Hi Palak,

Thanks for your interest in Syncfusion products. Please use your code in any one of the following event. It will work fine.


chartControl1.LayoutCompleted += new EventHandler(chartControl1_LayoutCompleted);

void chartControl1_LayoutCompleted(object sender, EventArgs e)
{
chart1.PrimaryYAxis.AutoSize = false;
chart1.PrimaryYAxis.RealLength = 100;
yaxis.AutoSize = false;
yaxis.RealLength = 150;
}


chartControl1.ChartAreaPaint += new PaintEventHandler(chartControl1_ChartAreaPaint);

void chartControl1_ChartAreaPaint(object sender, PaintEventArgs e)
{
chart1.PrimaryYAxis.AutoSize = false;
chart1.PrimaryYAxis.RealLength = 100;
yaxis.AutoSize = false;
yaxis.RealLength = 150;
}


We are not having direct support for your second requirement.
By customizing the value of RealLengths, you can meet this requirement.

Please let us know if this helps.

Regards,
Venkat.

Palak Jain
Replied On March 15, 2010 03:04 PM UTC

Thanks Venkat for the reply but I had tried that already and there's still an issue.

I have added the resizing code in the LayoutComplete event. The resizing of the axes works fine. But the problem is the tick labels are still being painted as if the axes were equal length.

Also, the first time the chart is created, the axes labels are painted along side the grid intervals. But after that everytime the chart updates/resizes, the label positions shift. ( I am attaching the screenshots.)


I also added code to set the TickLabelsDrawingMode for all the axes to AutomaticMode. It doesn't help!
chart1.PrimaryYAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.AutomaticMode;

Thanks again,
Palak.



Label Positions_7dc2545a.zip

Palak Jain
Replied On March 18, 2010 01:27 PM UTC

Hi,

I tried using the above code in ChartAreaPaint event and this doesnot even resize the axes.

Any clue on how to change the label positions to match the grid intervals?

Thanks,
Palak.

Jaffersathick B [Syncfusion]
Replied On March 24, 2010 01:17 PM UTC

Hi Palak,


Thank you for your interest in Syncfusion products.


Sorry for the delay in getting back to you. We will have a follow up of for this forum in the Direct Trac incident id #66081.


Regards,
Jaffer.B

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.

Warning Icon 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.Close Icon

;