LastVisibleIndex not correct
LastVisibleIndex not correct
Hi,
Maybe I have something set causing this issue but when I go to the end of my candle data and query the LastVisibleIndex it shows 99. (I have 100 loaded for this example) If I pan to the left until that candle is gone and then query the LastVisibleIndex again it still shows 99. If I pan again to the left to hide the next one then it shows 98, which should be 97.
Is there something setup on the chart incorrectly that can cause this? I also notice that even though my MaxPointsPerPage is set to 50, I can see 52 candles when the chart is first displayed.
Thanks,
Kevin
Maybe I have something set causing this issue but when I go to the end of my candle data and query the LastVisibleIndex it shows 99. (I have 100 loaded for this example) If I pan to the left until that candle is gone and then query the LastVisibleIndex again it still shows 99. If I pan again to the left to hide the next one then it shows 98, which should be 97.
Is there something setup on the chart incorrectly that can cause this? I also notice that even though my MaxPointsPerPage is set to 50, I can see 52 candles when the chart is first displayed.
Thanks,
Kevin
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Re: LastVisibleIndex not correct
Hello Kevin,
Ok, I can reproduce this issue here and have added it to our bug tracking software with reference TF02013319. Please be aware that this defect has already been fixed for the next maintenance release due out in the next few days. Also, please note that the value of 99 is correct. Series indexes start at zero, so the 100th point has an index of 99. What isn't correct is the LastVisibleIndex value of 50 on the first page (which should be 49).WD_Gordon wrote:Maybe I have something set causing this issue but when I go to the end of my candle data and query the LastVisibleIndex it shows 99. (I have 100 loaded for this example) If I pan to the left until that candle is gone and then query the LastVisibleIndex again it still shows 99. If I pan again to the left to hide the next one then it shows 98, which should be 97.
I'm afraid I haven't been able to reproduce this one. Of the times I've tested it, the number of visible points has been exactly 50.WD_Gordon wrote: Is there something setup on the chart incorrectly that can cause this? I also notice that even though my MaxPointsPerPage is set to 50, I can see 52 candles when the chart is first displayed.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello Kevin,
I see, ok. Well, taking into account the MaximumOffset and MinimumOffset when performing the calculation of the FirstVisibleIndex and LastVisibleIndex properties was one of the issues that had to be addressed for TF02013319. I would expect this area to work considerably better.WD_Gordon wrote:I found the issue where it was showing 2 extra candles. I had the Axes.Right.MaximumOffset property set to 20, which caused the 2 extra candles to display. Probably because it was set so high. I backed it back down to 5 and it works fine now.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher,
I am not so sure TF02013319 fixed this issue.
1. It appears that setting the MinimumOffset or MaximumOffset properties no longer works.
2. I am no longer using the Page.MaxPointsPerPage property to determine the number of candles displayed. I am trying to use the SetMinMax method but it seems that the FirstVisibleIndex and LastVisibleIndex doesn't always represent the correct index.
I can load call SetMinMax(0, 9) and expect to see 10 candles, which I do. The First and LastVisibleIndex are correct, 0 and 9. But if I pan just a pixel or 2 to the right, the LastVisibleIndex jumps to 10, but that candle is far from being seen.
3. I have also noticed a difference in how the left most candle is removed from the chart before hitting the edge where as the right most candle scrolls off the chart.
4. I added code in the AllowScroll event to control panning. It appears to work for the most part other than it gets in a state where the first candle will not always display.
I have created a very small sample application that demonstrates everything I have mentioned above. If you would like it I can get it to you if you explain to me how to send it.
Thanks,
Kevin
I am not so sure TF02013319 fixed this issue.
1. It appears that setting the MinimumOffset or MaximumOffset properties no longer works.
2. I am no longer using the Page.MaxPointsPerPage property to determine the number of candles displayed. I am trying to use the SetMinMax method but it seems that the FirstVisibleIndex and LastVisibleIndex doesn't always represent the correct index.
I can load call SetMinMax(0, 9) and expect to see 10 candles, which I do. The First and LastVisibleIndex are correct, 0 and 9. But if I pan just a pixel or 2 to the right, the LastVisibleIndex jumps to 10, but that candle is far from being seen.
3. I have also noticed a difference in how the left most candle is removed from the chart before hitting the edge where as the right most candle scrolls off the chart.
4. I added code in the AllowScroll event to control panning. It appears to work for the most part other than it gets in a state where the first candle will not always display.
Code: Select all
if (a == this.tChart1.Axes.Bottom)
{
if (e.Min < 0 || e.Max > this.pointsToLoad - 1)
e.AllowScroll = false;
else
e.AllowScroll = true;
}
Thanks,
Kevin
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Kevin,
Yes please, send us the example project at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Yes please, send us the example project 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 |
Hi Narcís,
I cannot get to any of the addresses you specified. Both IE and FireFox says that www.steema.net\uploads or even www.steema.net does not exist. Is the server down?
Thanks,
Kevin
I cannot get to any of the addresses you specified. Both IE and FireFox says that www.steema.net\uploads or even www.steema.net does not exist. Is the server down?
Thanks,
Kevin
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Kevin,
No the problem is a major issue in a datacenter or DNS server which is afecting most spanish ISPs today . Using steema.net's IP should solve the problem:
http://217.126.48.36/upload/
Hope this helps!
No the problem is a major issue in a datacenter or DNS server which is afecting most spanish ISPs today . Using steema.net's IP should solve the problem:
http://217.126.48.36/upload/
Hope this helps!
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:
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: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
"In fact there is a twitter created where comment that could have caused a fire in the circuit of the air conditioning in the building."
Should read:
"In fact a twitter has been created which comments that a fire caused by a short circuit in an air conditioning unit could have produced the problem."
Spain
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Kevin,
I wonder if the reference you have in your project is set to the correct one, the lastest version?
Using the latest build, released today, the following code seems to work just fine:Kevin wrote:Christopher,
1. It appears that setting the MinimumOffset or MaximumOffset properties no longer works.
Code: Select all
private void InitializeChart()
{
tChart1 = new Steema.TeeChart.TChart();
watch = new System.Diagnostics.Stopwatch();
tChart1.Dock = DockStyle.Fill;
this.panel1.Controls.Add(tChart1);
tChart1.Aspect.View3D = false;
tChart1.Series.Add(series = new Candle());
series.FillSampleValues();
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.Axes.Left.MaximumOffset = 100;
}
This behaviour is by design, that is to say, that a candle's date value is from the previous date value to the one you set it. This means that adding an hour to a value, as in the code below, will cause the first and last to jump one. We could discuss making the date value of a candle "in the middle" of the previous one and the next one, but this would certainly slow down the candle series if this were the default case as there is no guarantee that date values will be equidistant. Maybe we could come up with an idea for a new property ...Kevin wrote: I can load call SetMinMax(0, 9) and expect to see 10 candles, which I do. The First and LastVisibleIndex are correct, 0 and 9. But if I pan just a pixel or 2 to the right, the LastVisibleIndex jumps to 10, but that candle is far from being seen.
Code: Select all
private void InitializeChart()
{
tChart1 = new Steema.TeeChart.TChart();
watch = new System.Diagnostics.Stopwatch();
tChart1.Dock = DockStyle.Fill;
this.panel1.Controls.Add(tChart1);
tChart1.Aspect.View3D = false;
tChart1.Series.Add(series = new Candle());
DateTime today = DateTime.Today;
for (int i = 0; i < 50; i++)
{
series.Add(today, 50, 100, 0, 75);
today = today.AddDays(1);
}
tChart1.Axes.Bottom.SetMinMax(DateTime.Today.AddHours(1), DateTime.Today.AddDays(9).AddHours(1));
}
private void button1_Click(object sender, EventArgs e)
{
string message = "First: " + series.FirstVisibleIndex.ToString() +
" First: " + series.LastVisibleIndex.ToString();
MessageBox.Show(message);
}
I'll have to wait for you to upload your example project, as here I can't immediately see what you mean. Maybe an image or two would help?Kevin wrote: 3. I have also noticed a difference in how the left most candle is removed from the chart before hitting the edge where as the right most candle scrolls off the chart.
Running the following code seems to work as expected, that is, e.AllowScroll is set to false. Please be aware that you should be checking for datetime values, as in the code below:Kevin wrote: 4. I added code in the AllowScroll event to control panning. It appears to work for the most part other than it gets in a state where the first candle will not always display.
Code: Select all
private void InitializeChart()
{
tChart1 = new Steema.TeeChart.TChart();
watch = new System.Diagnostics.Stopwatch();
tChart1.Dock = DockStyle.Fill;
this.panel1.Controls.Add(tChart1);
tChart1.Aspect.View3D = false;
tChart1.Series.Add(series = new Candle());
DateTime today = DateTime.Today;
for (int i = 0; i < 50; i++)
{
series.Add(today, 50, 100, 0, 75);
today = today.AddDays(1);
}
tChart1.AllowScroll+=new TChart.AllowScrollEventHandler(tChart1_AllowScroll);
tChart1.Axes.Bottom.SetMinMax(DateTime.Today, DateTime.Today.AddDays(this.pointsToLoad - 1));
}
private int pointsToLoad = 10;
void tChart1_AllowScroll(Axis a, TChart.AllowScrollEventArgs e)
{
if (a == this.tChart1.Axes.Bottom)
{
if (e.Min < DateTime.Today.ToOADate() || e.Max > DateTime.Today.AddDays(this.pointsToLoad - 1).ToOADate())
e.AllowScroll = false;
else
e.AllowScroll = true;
}
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hey Christopher,
In reference to your answer of question 4, I can't use dates. This is an issue which I addressed a couple of months ago. We divide our candles into several increments such as 5, 15, 30 minute candles and such. The issue is when the markets close Friday evening and reopen Sunday there are large gaps in the chart. You guys mentioned that you may address this in the future. As for now, I load the candles numerically and handle the date/time labeling in the GetAxisDrawLabel event. That eliminates the gaps.
You will see the issue I mentioned in the sample project I just uploaded.
Thanks,
Kevin
In reference to your answer of question 4, I can't use dates. This is an issue which I addressed a couple of months ago. We divide our candles into several increments such as 5, 15, 30 minute candles and such. The issue is when the markets close Friday evening and reopen Sunday there are large gaps in the chart. You guys mentioned that you may address this in the future. As for now, I load the candles numerically and handle the date/time labeling in the GetAxisDrawLabel event. That eliminates the gaps.
You will see the issue I mentioned in the sample project I just uploaded.
Thanks,
Kevin
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Kevin,
Any comments on any of my other responses?
I see, no problem.Kevin wrote:In reference to your answer of question 4, I can't use dates. This is an issue which I addressed a couple of months ago.
Any comments on any of my other responses?
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher,
Ref # 1: Well I just downloaded the latest and using your code I set the values but they still have no effect. I even cut and past the code you showed above. After looking even deeper I notice that when I changed the MaximumOffset in a button event it appears that the property is not retaining the value. Click the button a second time and it shows its original value.
Ref # 2: I understand what you are saying but it is a little confusing as one would expect if the LastVisibleIndex, "visible" being the key here, equals 10 then you would expect to actually see that candle on the chart.
Ref # 3: You stated you would have to wait for the sample to # 3, did you observe the same thing and is this by design? (See comments for #4)
Ref # 4: So you do not see what I am seeing, where if you pan to the right then back to the left a few times the first candle will not be displayed? Well I can produce it everytime on my dev box but on another dev box next to me it works just fine. As a matter of fact # 3 works fine on that one as well. This must have to do with the video driver on my box.
Thanks,
Kevin
Ref # 1: Well I just downloaded the latest and using your code I set the values but they still have no effect. I even cut and past the code you showed above. After looking even deeper I notice that when I changed the MaximumOffset in a button event it appears that the property is not retaining the value. Click the button a second time and it shows its original value.
Ref # 2: I understand what you are saying but it is a little confusing as one would expect if the LastVisibleIndex, "visible" being the key here, equals 10 then you would expect to actually see that candle on the chart.
Ref # 3: You stated you would have to wait for the sample to # 3, did you observe the same thing and is this by design? (See comments for #4)
Ref # 4: So you do not see what I am seeing, where if you pan to the right then back to the left a few times the first candle will not be displayed? Well I can produce it everytime on my dev box but on another dev box next to me it works just fine. As a matter of fact # 3 works fine on that one as well. This must have to do with the video driver on my box.
Thanks,
Kevin
Last edited by WD_Gordon on Tue Sep 23, 2008 7:51 pm, edited 1 time in total.