iso axes but also scaled
iso axes but also scaled
The MakeIsoAxis sample code works but I need one more feature for my TPointSeries charts.
For example, if my x variable goes from 0 to 1 but my y variable goes from only 0 to 0.5 then I want the height of the vertical axis to be half the length of the x axis. What MakeIsoAxis does is to change the offset to extend the axes as necessary to fit the space allocated to the chart. I need the chartwidth and chartheight to be proportional to the desired ranges of the x and y axes (that is, for the chart to be half as tall as it is wide). Note: not always a factor of 0.5, the range will depend on the data entered by the user. I cannot seem to change the chartwidth and chartheight directly because they are read-only.
Is there a simple way to do this? If so, then I will also need an equivalent solution for 3D points (for my next project).
Thanks, Jim
For example, if my x variable goes from 0 to 1 but my y variable goes from only 0 to 0.5 then I want the height of the vertical axis to be half the length of the x axis. What MakeIsoAxis does is to change the offset to extend the axes as necessary to fit the space allocated to the chart. I need the chartwidth and chartheight to be proportional to the desired ranges of the x and y axes (that is, for the chart to be half as tall as it is wide). Note: not always a factor of 0.5, the range will depend on the data entered by the user. I cannot seem to change the chartwidth and chartheight directly because they are read-only.
Is there a simple way to do this? If so, then I will also need an equivalent solution for 3D points (for my next project).
Thanks, Jim
Re: iso axes but also scaled
Hi Jim,
I've extracted the "Isometric Axis" demo from the Features Demo and modified it to use a TPointSeries with values in the ranges you mentioned.
But I'm not sure to understand what would you like to achieve here.
This is how it looks: And here it is the project:
I've extracted the "Isometric Axis" demo from the Features Demo and modified it to use a TPointSeries with values in the ranges you mentioned.
But I'm not sure to understand what would you like to achieve here.
This is how it looks: And here it is the project:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: iso axes but also scaled
thanks. the result you show if fine (though the 1.0 at the right is not shown along the horizontal axis). I will try your suggested changes.
Jim
Jim
Re: iso axes but also scaled
One problem remains. Your example extends the scale of the x or y axes so that the chart fills the window while keeping the scales isometric. I need the min and max values on the axes to remain the same. That is, I do not want the min or max values for the scales to be increased - just the axes stretched or compressed as necessary to make the axes isometric. I need to connect this to the resize event so the user can make the window (and the chart) larger or smaller while keeping the axes isometric.
Thanks!
Thanks!
Re: iso axes but also scaled
Hello,
I'm not sure to understand what do you mean.
In these examples we are calling MinMax to change the axes scale and this already stretches/compresses the axes.
If you could draw a draft showing what would you expect to get, it may help me to understand it.
I'm not sure to understand what do you mean.
In these examples we are calling MinMax to change the axes scale and this already stretches/compresses the axes.
If you could draw a draft showing what would you expect to get, it may help me to understand it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: iso axes but also scaled
I have attached an example. Note all the uninformative regions to the left of 0.0 and right of 1.0. What I want is for the window to be constrained so that those areas need not be plotted. In the present example it means that the plotting canvas needs to be constrained so it is twice as wide as high no matter how large or small the user makes the window.
thanks!
thanks!
- Attachments
-
- Screen Shot 09-26-15 at 01.36 PM.PNG (24.04 KiB) Viewed 33433 times
Re: iso axes but also scaled
Hello,
I've modified the project above including a button that modifies the ChartRect to the minimum needed to display all the points.
Take a look at it:
I've modified the project above including a button that modifies the ChartRect to the minimum needed to display all the points.
Take a look at it:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: iso axes but also scaled
Getting closer. I will see if I can modify this new version to do what I want. Make iso would be ok if it shrunk the size of the teechart component to be just a little larger than what is actually used to display the plot.
Thanks,
Jim
Thanks,
Jim
Re: iso axes but also scaled
Unfortunately, still a problem. I need to know some more parameters before I can modify your code to do what I want. I guess it is a little hard to describe. I will try again. In your example if i click iso and then resize I get the first part of what I want. I then need to adjust the Tchart component to match the actual plot.
I need to know the width of the horizontal axes + any labels + legend (if present) so I can make the Tchart width equal to that. Then I need to know the height of the vertical axis + labels + titles so I can make the height of the Tchart equal to that. I don't want to fit the Tchart to the client, I want to adjust the client to fit the chart. Then I want the form's resize event to adjust the size of the Tchart while keeping the width and height of the Tchart in the proper proportion so the axes will remain isometric.
clearer?
Jim
I need to know the width of the horizontal axes + any labels + legend (if present) so I can make the Tchart width equal to that. Then I need to know the height of the vertical axis + labels + titles so I can make the height of the Tchart equal to that. I don't want to fit the Tchart to the client, I want to adjust the client to fit the chart. Then I want the form's resize event to adjust the size of the Tchart while keeping the width and height of the Tchart in the proper proportion so the axes will remain isometric.
clearer?
Jim
Re: iso axes but also scaled
Perhaps it will be more clear with a simple example. See the attached ZIP file. It plots x and y axes for data where x ranges from 0 to 4 but y only ranges from 0 to 2. Note that with the checkbox checked one can resize the window and the plot will fill as much of the window as it can while still keeping the lengths of the axes in proper proportion. When not checked the axes simply fill the window and are not usually in proper portion.
My problem using TeeChart is that i do not know how much width (in pixels) will be taken up by labels and marks for the vertical axis and the legend when displayed. I also do not know how much space (also in pixels) will be taken up by any titles, subtitles, and labels and marks for the horizontal axis. I suspect there must be a way to obtain this information but I have not yet found it in the documentation.
This is important for my application because it is for a statistical application where the units for the two axes must be the same.
thanks
My problem using TeeChart is that i do not know how much width (in pixels) will be taken up by labels and marks for the vertical axis and the legend when displayed. I also do not know how much space (also in pixels) will be taken up by any titles, subtitles, and labels and marks for the horizontal axis. I suspect there must be a way to obtain this information but I have not yet found it in the documentation.
This is important for my application because it is for a statistical application where the units for the two axes must be the same.
thanks
- Attachments
-
- DemoIsoProblem.zip
- Example of isometric plot without using TeeChart.
- (5.04 KiB) Downloaded 1336 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: iso axes but also scaled
Hi Jim,
Thanks for your feedback, I think I got your point. I created a new example project with a completely different approach, which consist on using CutomChartRect property.
Thanks for your feedback, I think I got your point. I created a new example project with a completely different approach, which consist on using CutomChartRect property.
- Attachments
-
- CustomChartRectIsoAxes.zip
- (2.66 KiB) Downloaded 1384 times
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 |
Re: iso axes but also scaled
Sorry, but not quite yet.
One thing that would help would be to tell me that given a certain axis lengths (found using the chart1.ChartRect in your example) how wide and tall the resulting chart will be in pixels (when including the axes labels and titles and the legend if it is visible). I could then try to resize the window around it so it will just fit. In looking at the documentation, it seems that there are quite a few things to take into account. There are also margins that seem to be set as percentages so i would need to convert to pixels. I suspect there are many more things to take into account. Is there any way to get the outer bounds for the actual plot?
I think I am going to have the same problems when I try to print.
One thing that would help would be to tell me that given a certain axis lengths (found using the chart1.ChartRect in your example) how wide and tall the resulting chart will be in pixels (when including the axes labels and titles and the legend if it is visible). I could then try to resize the window around it so it will just fit. In looking at the documentation, it seems that there are quite a few things to take into account. There are also margins that seem to be set as percentages so i would need to convert to pixels. I suspect there are many more things to take into account. Is there any way to get the outer bounds for the actual plot?
I think I am going to have the same problems when I try to print.
Re: iso axes but also scaled
I may be getting to a solution. I can find the size of all that extra stuff by comparing chart1.width with chart1.chartwidth and chart1.height with chart1.chartheight. Then I need to find out how make the chartwidth and chartheight proportional to the scale of my data and fill the window efficiently.
Re: iso axes but also scaled
I seemed to have solved my problem for keeping axes isometric as a window is resized. I have attached a demo. Please let me know if you find a more efficient or more compact solution.
Thanks for your help,
Jim
Thanks for your help,
Jim
- Attachments
-
- KeepIso.zip
- (4.89 KiB) Downloaded 1495 times
Re: iso axes but also scaled
Hello Jim,
I'm looking at your solution and it looks very good! Thanks for sharing it!
I'm glad to hear you got it!fjrohlf wrote:I seemed to have solved my problem for keeping axes isometric as a window is resized. I have attached a demo. Please let me know if you find a more efficient or more compact solution.
I'm looking at your solution and it looks very good! Thanks for sharing it!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |