Bar chart showing positive and negative values on x-Axis
Bar chart showing positive and negative values on x-Axis
I want to plot a bar graph which will display positive values on the right side and negative values on the left hand side.The positive and negative values will appear on the horizontal axis.I am new to Teechart So kindly help me to solve my problem.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tina,
Sorry but I don't fully understand what you are trying to achieve exactly. However, reading Tutorial 4 - Axis Control may be really helpful. You'll find the tutorials at TeeChart's program group.
If this doesn't help please give us some more details about what are you trying to achieve.
Thanks in advance.
Sorry but I don't fully understand what you are trying to achieve exactly. However, reading Tutorial 4 - Axis Control may be really helpful. You'll find the tutorials at TeeChart's program group.
If this doesn't help please give us some more details about what are you trying to achieve.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
is there any way to send a screenshot or attachment so that it will be more clear. Also do you have any helpline phone no. where we can call you guys and describe it.
Basically I have a data
radio 30
tv -50
paper 60
Now when i plot a bar graph i get a graph in which on X axis i can see radio,tv and paper and on Y axis i can see -60 to 60 values. Now what i want is that on X axis I should be able to see -60 to 60 and Y axis should cut X axis at 0. Thus the resultant bars will be either on right or on left of Y axis.Please let me know how to achieve it preferably by some sample code. Its highly highly urgent requirement and we need v urgent support on this.Many thanks in advance.[/img]
Basically I have a data
radio 30
tv -50
paper 60
Now when i plot a bar graph i get a graph in which on X axis i can see radio,tv and paper and on Y axis i can see -60 to 60 values. Now what i want is that on X axis I should be able to see -60 to 60 and Y axis should cut X axis at 0. Thus the resultant bars will be either on right or on left of Y axis.Please let me know how to achieve it preferably by some sample code. Its highly highly urgent requirement and we need v urgent support on this.Many thanks in advance.[/img]
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tina,
Yes, it would be very helpful if you could send us an image of your requirements or even also a simple example project. You can send your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
We don't have a support phone line. If you are looking for priority support you may be interested in our Pro-Support program described here.
Thanks in advance.
Yes, it would be very helpful if you could send us an image of your requirements or even also a simple example project. You can send your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
We don't have a support phone line. If you are looking for priority support you may be interested in our Pro-Support program described here.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Y AXIS SHOULD CUT x AXIS AT ZERO
I have uploaded the screen shoot . I want my Y axis to cut x axis always on zero.Also x axis scale may change everytime the application runs. We have tried doing this by settinng position % of Y axis to 50% but it does not set it accurately(ie it does not erxacly cut x axis at zero). How to achieve this?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tina,
Thanks for the image.
You can find an example of what you request here. This example always positions horizontal and vertical axes on zero position. This is a TeeChart Pro ActiveX example but the same should be applied to TeeChart for .NET.
Thanks for the image.
You can find an example of what you request here. This example always positions horizontal and vertical axes on zero position. This is a TeeChart Pro ActiveX example but the same should be applied to TeeChart for .NET.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Thanks I tried using this code in my .NET program
tChart1.Axes.Left.PositionUnits=puPercent;
tChart1.Axes.Left.PositionPercent = 50;
but it gives these errors:
1. pupercent does not exist in the class or namespace 'test_teechart.Form1".
2.
steema.teechart.axis does not contain definiotion for PositionPercent
tChart1.Axes.Left.PositionUnits=puPercent;
tChart1.Axes.Left.PositionPercent = 50;
but it gives these errors:
1. pupercent does not exist in the class or namespace 'test_teechart.Form1".
2.
steema.teechart.axis does not contain definiotion for PositionPercent
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tina,
Please find below the answers to your questions:
1. You should use this:
2. Try using:
Please find below the answers to your questions:
1. You should use this:
Code: Select all
tChart1.Axes.Left.PositionUnits == Steema.TeeChart.PositionUnits.Percent
Code: Select all
teeChart.Axes.Left.RelativePosition = 50;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tina,
Would you be so kind to also send an example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Would you be so kind to also send an example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tina,
Thanks for your example project. It almost has nothing to do with the example I pointed you at. However this works fine like this:
Please notice that you'd better implement the axis positioning code at the AfterDraw event so that every time the chart is scrolled or zoomed the axes will be automatically repositioned. Also, to have valid axes positions to set up left axis I used the Bitmap call to have the chart being internally drawn and axes positions have valid values.
Thanks for your example project. It almost has nothing to do with the example I pointed you at. However this works fine like this:
Code: Select all
private void button1_Click(object sender, System.EventArgs e)
{
horizBar1.Add(-3,"Pears",Color.Red);
horizBar1.Add(4,"Apples",Color.Blue);
horizBar1.Add(2,"Oranges",Color.Green);
Bitmap bmp = tChart2.Bitmap;
tChart2.Axes.Left.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
tChart2.Axes.Left.RelativePosition = tChart2.Axes.Bottom.CalcXPosValue(0) - tChart2.Axes.Left.Position;
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |