How to fit all the lines into a chart
How to fit all the lines into a chart
I have a fixed tool window as a client and on which a teechart is docked. Now I try to place some lines whose lengths are not know and upon doing it the part of the line is beyond the size of teechart.
How can I fit all the lines into a teechart? In future, the fixed tool window may be re-sizable.
Thanks.
How can I fit all the lines into a teechart? In future, the fixed tool window may be re-sizable.
Thanks.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to fit all the lines into a chart
Raavi,
Would you be so kind as to create a Short, Self Contained, Correct (Compilable), Example with which I can see your issue here?Raavi wrote:I have a fixed tool window as a client and on which a teechart is docked. Now I try to place some lines whose lengths are not know and upon doing it the part of the line is beyond the size of teechart.
How can I fit all the lines into a teechart? In future, the fixed tool window may be re-sizable.
Best Regards,
Christopher Ireland / 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: How to fit all the lines into a chart
Sorry. I have to pick up the right words or an example to demonstrate.
But, I got 'false' for 'Chart.Zoom.Zoomed'. which tells me that not all Chart point fit into Chart.
But, I got 'false' for 'Chart.Zoom.Zoomed'. which tells me that not all Chart point fit into Chart.
Re: How to fit all the lines into a chart
On clicking Test button one may notice the part of the rectangle goes out of the chart.
I rather like to implement to fit all the lines in the chart. Some sort of autozoom.
I rather like to implement to fit all the lines in the chart. Some sort of autozoom.
- Attachments
-
- TestingTeeChartScaling.zip
- (44.55 KiB) Downloaded 725 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to fit all the lines into a chart
If I change the code to:Raavi wrote:On clicking Test button one may notice the part of the rectangle goes out of the chart.
I rather like to implement to fit all the lines in the chart. Some sort of autozoom.
Code: Select all
private void AddSeriesToChart()
{
m_Sum = 10.0;
Best Regards,
Christopher Ireland / 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: How to fit all the lines into a chart
1) What should I have to do thereby, 'm_Chart.Zoom.Zoomed' returns 'true'
2) If I set m_Sum += 10.0; then part of the lines go out of the Chart. This should not happen rather it should 'zoom out' to fit all lines in a given Chart size and the same for m_Sum -= 10 and in this case it should 'zoom in'.
* My problem is I cannot change the Chart size so I have to play with Zoom in and Zoom out by keeping Aspect ratio fixed either horizontally or vertically.
2) If I set m_Sum += 10.0; then part of the lines go out of the Chart. This should not happen rather it should 'zoom out' to fit all lines in a given Chart size and the same for m_Sum -= 10 and in this case it should 'zoom in'.
* My problem is I cannot change the Chart size so I have to play with Zoom in and Zoom out by keeping Aspect ratio fixed either horizontally or vertically.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to fit all the lines into a chart
I see. Maybe the problem is that the internal Series statistics aren't being updated as you set the ValueList.Value array directly. You could try:Raavi wrote:1) What should I have to do thereby, 'm_Chart.Zoom.Zoomed' returns 'true'
2) If I set m_Sum += 10.0; then part of the lines go out of the Chart. This should not happen rather it should 'zoom out' to fit all lines in a given Chart size and the same for m_Sum -= 10 and in this case it should 'zoom in'.
* My problem is I cannot change the Chart size so I have to play with Zoom in and Zoom out by keeping Aspect ratio fixed either horizontally or vertically.
m_Line.XValues.Count = 6;
m_Line.XValues.Value = m_RectangleX;
m_Line.XValues.Modified = true;
m_Line.YValues.Count = 6;
m_Line.YValues.Value = m_RectangleY;
m_Line.YValues.Modified = true;
Best Regards,
Christopher Ireland / 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: How to fit all the lines into a chart
I think, I can demonstrate what I mean about the lines not fitting into the chart with the attached solution.
* I cannot change the size of the Chart.
* I do not know what the dimensions for the line are.
In that case, however the line is defined it should fit into Chart.
* I cannot change the size of the Chart.
* I do not know what the dimensions for the line are.
In that case, however the line is defined it should fit into Chart.
- Attachments
-
- TestingTeeChartScaling.zip
- (45.92 KiB) Downloaded 692 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to fit all the lines into a chart
Try:Raavi wrote:I think, I can demonstrate what I mean about the lines not fitting into the chart with the attached solution.
* I cannot change the size of the Chart.
* I do not know what the dimensions for the line are.
In that case, however the line is defined it should fit into Chart.
Code: Select all
m_Chart.Axes.Bottom.Automatic = true;
m_Chart.Axes.Bottom.MinimumOffset = 10;
m_Chart.Axes.Bottom.MaximumOffset = 10;
//m_Chart.Axes.Bottom.Visible = false;
m_Chart.Axes.Bottom.Ticks.Length = 0;
m_Chart.Axes.Bottom.Labels.Visible = false;
m_Chart.Axes.Bottom.AxisPen.Visible = false;
m_Chart.Axes.Left.Automatic = true;
m_Chart.Axes.Left.MinimumOffset = 10;
m_Chart.Axes.Left.MaximumOffset = 10;
//m_Chart.Axes.Left.Visible = false;
m_Chart.Axes.Left.Ticks.Length = 0;
m_Chart.Axes.Left.Labels.Visible = false;
m_Chart.Axes.Left.AxisPen.Visible = false;
Best Regards,
Christopher Ireland / 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: How to fit all the lines into a chart
I beg your pardon, I do not see any change with the suggestion.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to fit all the lines into a chart
Yes, I'm sorry, those changes seem to be irrelevant. The relevant change is commenting out this line:Raavi wrote:I beg your pardon, I do not see any change with the suggestion.
Code: Select all
//m_Chart.BeforeDrawSeries += (sender, d) => m_Chart.Chart.Axes.Bottom.AdjustMaxMin();
Best Regards,
Christopher Ireland / 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: How to fit all the lines into a chart
Works but it breaks on re-sizing the window.
Nice video demonstration. Thanks.
Nice video demonstration. Thanks.
Re: How to fit all the lines into a chart
Though it is not a strict criterion but things may change in the future. Like, fixed size Chart to re-sizable.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to fit all the lines into a chart
I'm sorry, I thought that when you said "I cannot change the size of the Chart." you meant that the size of the Chart couldn't be changed.Raavi wrote:Works but it breaks on re-sizing the window.
So the size of the Chart *can* be changed, but only when the client resizes, is that correct?
Best Regards,
Christopher Ireland / 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 |
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to fit all the lines into a chart
If I comment out the line:Raavi wrote:Though it is not a strict criterion but things may change in the future. Like, fixed size Chart to re-sizable.
Code: Select all
//m_Line.IsoHorizAxes = true;
I am a little confused as to exactly what your requirements are, I'm sorry.
Best Regards,
Christopher Ireland / 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 |