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.
Syncfusion Feedback

How to change Y Axis''s value to the 1 more arrange?

Thread ID:

Created:

Updated:

Platform:

Replies:

68320 Sep 18,2007 03:46 AM Oct 2,2007 01:51 PM ASP.NET Web Forms (Classic) 8
loading
Tags: Chart
hweehoon
Asked On September 18, 2007 03:46 AM

Dear All,
May I know is there any possibility to set my Y axis value to 0, 20, 40, 60, 80, 100 and so on for graph 1 below and – 100, -80, -60, - 40, -20, 0, 20, 40, 60 and so on for graph 2 below?

p/s: please refer my attachment. thanks

hwee hoon

Question.zip

Melba Winshia [Syncfusion]
Replied On September 20, 2007 02:07 AM

Hi,

Thank you for your interest in Syncfusion Products.

Issue 1: (to set my Y axis value to 0, 20, 40, 60, 80, 100)
-----

You can set Y-axis value to 0, 20, 40, 60, 80, 100 by using the below code snippet.

//Set the Axes Range.
this.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.ChartWebControl1.PrimaryYAxis.Range = new MinMaxInfo(0, 100, 20);

Issue 2: (– 100, -80, -60, - 40, -20, 0, 20, 40, 60 )
------

You can set Y-axis value to – 100, -80, -60, - 40, -20, 0, 20, 40, 60 by using the below code snippet.

//Set the Axes Range.
this.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.ChartWebControl1.PrimaryYAxis.Range = new MinMaxInfo(-100, 60, 20);

Issue 3: (Currently I draw the legend myself by using picture box. Any others idea I can make it better)
--------

If your intention is to create a chart with legends, it can be achieved by using the FilterItems event. You can use ChartLegendItemType enum to select the type of legend (Rectangle, Image, Circle etc..) you need to display in the chart.

private void Legend_FilterItems(object sender, ChartLegendFilterItemsEventArgs e)
{

e.Items.Clear();
Syncfusion.Windows.Forms.Chart.ChartLegendItem s0 = new ChartLegendItem();
e.Items.Insert(0, s0);
e.Items[0].Type = ChartLegendItemType.Rectangle;
e.Items[0].Text = "-Best-In-Class";
e.Items[0].Interior = new Syncfusion.Drawing.BrushInfo(Color.Green);

Syncfusion.Windows.Forms.Chart.ChartLegendItem s1 = new ChartLegendItem();
e.Items.Insert(1, s1);
e.Items[1].Type = ChartLegendItemType.Circle;
e.Items[1].Text = "-Your Organization";
e.Items[1].Interior = new Syncfusion.Drawing.BrushInfo(Color.Yellow);

Syncfusion.Windows.Forms.Chart.ChartLegendItem s2 = new ChartLegendItem();
e.Items.Insert(2, s2);
e.Items[2].Type = ChartLegendItemType.Rectangle;
e.Items[2].Text = "-Average";
e.Items[2].Interior = new Syncfusion.Drawing.BrushInfo(Color.Lavender);

}


Please try this and let me know if this helps.

Thanks,
Melba

hweehoon
Replied On September 25, 2007 04:44 AM

Hi,
thanks for ur guide for the personalize legend. but for the primary axis problem after i apply with your setting i still have the decimal point for my Y axis.

any idea? thanks..

regards
hwee hoon

>Hi,

Thank you for your interest in Syncfusion Products.

Issue 1: (to set my Y axis value to 0, 20, 40, 60, 80, 100)
-----

You can set Y-axis value to 0, 20, 40, 60, 80, 100 by using the below code snippet.

//Set the Axes Range.
this.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.ChartWebControl1.PrimaryYAxis.Range = new MinMaxInfo(0, 100, 20);

Issue 2: (– 100, -80, -60, - 40, -20, 0, 20, 40, 60 )
------

You can set Y-axis value to – 100, -80, -60, - 40, -20, 0, 20, 40, 60 by using the below code snippet.

//Set the Axes Range.
this.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.ChartWebControl1.PrimaryYAxis.Range = new MinMaxInfo(-100, 60, 20);

Issue 3: (Currently I draw the legend myself by using picture box. Any others idea I can make it better)
--------

If your intention is to create a chart with legends, it can be achieved by using the FilterItems event. You can use ChartLegendItemType enum to select the type of legend (Rectangle, Image, Circle etc..) you need to display in the chart.

private void Legend_FilterItems(object sender, ChartLegendFilterItemsEventArgs e)
{

e.Items.Clear();
Syncfusion.Windows.Forms.Chart.ChartLegendItem s0 = new ChartLegendItem();
e.Items.Insert(0, s0);
e.Items[0].Type = ChartLegendItemType.Rectangle;
e.Items[0].Text = "-Best-In-Class";
e.Items[0].Interior = new Syncfusion.Drawing.BrushInfo(Color.Green);

Syncfusion.Windows.Forms.Chart.ChartLegendItem s1 = new ChartLegendItem();
e.Items.Insert(1, s1);
e.Items[1].Type = ChartLegendItemType.Circle;
e.Items[1].Text = "-Your Organization";
e.Items[1].Interior = new Syncfusion.Drawing.BrushInfo(Color.Yellow);

Syncfusion.Windows.Forms.Chart.ChartLegendItem s2 = new ChartLegendItem();
e.Items.Insert(2, s2);
e.Items[2].Type = ChartLegendItemType.Rectangle;
e.Items[2].Text = "-Average";
e.Items[2].Interior = new Syncfusion.Drawing.BrushInfo(Color.Lavender);

}


Please try this and let me know if this helps.

Thanks,
Melba

Question.zip

Melba Winshia [Syncfusion]
Replied On September 26, 2007 02:44 AM

Hi,

Thank you for the screenshot.

I am afraid that I was not able to reproduce the issue. Please refer to the following steps that I tried to reproduce it.

1. Created a sample by setting negative range for y axis
2. But not able to see decimal point in my Y axis

Also I have created a simple sample to test this issue and it is available in the following link.

http://websamples.syncfusion.com/samples/Chart.Web/5.2.0.25/68294_1/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba

hweehoon
Replied On September 27, 2007 04:23 AM

Thanks, i will try on your example when i free. any way thanks first. i just wonder y i will have decimal point. =)

hweehoon
Replied On September 27, 2007 11:39 PM

Hi,
Herewith attachment on my sample which i get decimal point to my YAxis. Just press the Open button you can get my graph (which attach together a xml file under bin)

thanks...

hwee hoon

TestOnGraphYAxis.zip

Administrator [Syncfusion]
Replied On October 1, 2007 10:46 AM

Hi Hwee,

Thanks for providing the sample.

If your intention is to display the integer values on Y axis, then please round off Y Axis values to zero decimal point.

Please refer the attached sample and let me know if this meets your requirement.

http://websamples.syncfusion.com/samples/Chart.Windows/F68320_Oct1/main.htm

Regards,
Jaya

hweehoon
Replied On October 1, 2007 10:15 PM

Hi,
If i need to show decimal point to my graph value instead of show it to round up value. is it my YAxis will remain the decimal point?

thanks..

regards
hwee hoon

Administrator [Syncfusion]
Replied On October 2, 2007 01:51 PM

Hi Hwee,

Thanks for the update.

Yes. The data points will be displayed in decimal point if the Y Axis values are in decimal point since data point received input from plotted series.

If your intention is to show decimal point at graph and non decimal point at Y Axis, then clear the existing labels and create desired labels at Y Axis.

Please let me know if you have any other queries.

Regards,
Jaya

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

;