Hi,
I have two area series in a chart. I have added custom axis for left of first series and bottom of second series. There is no other axis displayed. I have couple of questions:
- When there is no data, the axis are moving to the middle ( looking like '+' ). I want the origin to be at left bottom always ( like 'L'). How do I achieve this?
- I move the left axis (programatically) to the last point plotted on the chart. But user should not be able to move the axis on the chart. How do I restrict that?
Thanks.
Regards
Kiran
Axis and Origin
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Kiran,
When populating them you can set them back to automatic:
The only solution I can think of is that you manually set axes minimum and maximum values before populating your series:- When there is no data, the axis are moving to the middle ( looking like '+' ). I want the origin to be at left bottom always ( like 'L'). How do I achieve this?
Code: Select all
tChart1.Axes.Bottom.SetMinMax(0, 1);
tChart1.Axes.Left.SetMinMax(0, 1);
axis1.SetMinMax(0, 1);
axis2.SetMinMax(0, 1);
Code: Select all
tChart1.Axes.Bottom.Automatic = true;
tChart1.Axes.Left.Automatic = true;
axis1.Automatic = true;
axis2.Automatic = true;
Do you give access to the chart editor to your users? If so the only options is hidding the axes tab as shown in the What's New?\Welcome !\New in Components\Commander\Custom Editor example in the features demo, available at TeeChart's program group.- I move the left axis (programatically) to the last point plotted on the chart. But user should not be able to move the axis on the chart. How do I restrict that?
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 |
Hi,
By custom axis, I mean, I am adding two ColorLines and setting their axis to Left and Bottom. Programatically I am setting their values:
tool1.Value = chart.Series[ seriesIndex ].XValues.Maximum;
tool2.Value = chart.Series[ seriesIndex ].YValues.Maximum;
I am not exposing any chart editor to the user. But the user is able to relocate these colorlines in the chart by using the mouse. I want to restrict this.
Setting min/max does not solve my problem. Y values can still be all 0s with all valid X values and in which case the bottom axis moves to the middle. I do not want this happen. The axis origin should be at left bottom always.
I think this clarifies my issues. Kindly help. Thanks.
Regards
Kiran
By custom axis, I mean, I am adding two ColorLines and setting their axis to Left and Bottom. Programatically I am setting their values:
tool1.Value = chart.Series[ seriesIndex ].XValues.Maximum;
tool2.Value = chart.Series[ seriesIndex ].YValues.Maximum;
I am not exposing any chart editor to the user. But the user is able to relocate these colorlines in the chart by using the mouse. I want to restrict this.
Setting min/max does not solve my problem. Y values can still be all 0s with all valid X values and in which case the bottom axis moves to the middle. I do not want this happen. The axis origin should be at left bottom always.
I think this clarifies my issues. Kindly help. Thanks.
Regards
Kiran
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Kiran,
BTW: You may also be interested in knowing of TeeChart's built-in custom axes feature. You'll find information at Tutorial 4 - Axis Control and examples at All Features\Welcome!\Axes in the features demo. Tutorials and demo can be found at TeeChart's program group.
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Ok, in that case you can prevent your users from dragging ColorLine tools like this:By custom axis, I mean, I am adding two ColorLines and setting their axis to Left and Bottom. Programatically I am setting their values:
tool1.Value = chart.Series[ seriesIndex ].XValues.Maximum;
tool2.Value = chart.Series[ seriesIndex ].YValues.Maximum;
I am not exposing any chart editor to the user. But the user is able to relocate these colorlines in the chart by using the mouse. I want to restrict this.
Code: Select all
colorLine1.AllowDrag = false;
I may not be understanding your problem but in the chase that all Y values are zero than you may also need to set left axis min. and max. values (e.g.: tChart1.Axes.Left.SetMinMax(-1,1);).Setting min/max does not solve my problem. Y values can still be all 0s with all valid X values and in which case the bottom axis moves to the middle. I do not want this happen. The axis origin should be at left bottom always.
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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 |