Page 1 of 1

Scrollbar components overlap

Posted: Fri Feb 17, 2017 6:13 pm
by 15048900
Hello:

Here is a scrollbar I added to a legend using example code provided by you in another (recent) post.
Overlap.PNG
Overlap.PNG (10.54 KiB) Viewed 23240 times
If you examine the "arrow" parts of the bar you will see that when the thumb is all the way up (0), there is some overlap in the rendering, but if the thumb is on the bottom (max), there is no overlap. Is there way to control this? Or maybe you could clean this up?

Thanks

Re: Scrollbar components overlap

Posted: Mon Feb 20, 2017 11:08 am
by Christopher
Hello,
biqpaulson wrote: If you examine the "arrow" parts of the bar you will see that when the thumb is all the way up (0), there is some overlap in the rendering, but if the thumb is on the bottom (max), there is no overlap. Is there way to control this? Or maybe you could clean this up?
This has been added to our issue tracker with id=1792, and a 'fix' to it has been made which will be included in the next maintenance release.

Re: Scrollbar components overlap

Posted: Tue Mar 21, 2017 3:42 pm
by 15048900
Hello. Using the TeeChartNET2017_4.1.2017.03140.exe release, I don't see this as being fixed. It's possible it's been changed slightly but not fixed.

For example:
Capture.PNG
Capture.PNG (2.46 KiB) Viewed 23191 times
In this image, you can see the top does not look the same as the bottom. The top has a 2 pixel line "touching" the top part of the arrow, while the bottom has a one pixel line with a one pixel gap and does not touch the bottom arrow.

Also, when one scrolls to the bottom, the darker 1 pixel line on the thumb just touches the bottom line, making a nice 2 pixel line. But when one scrolls to the top, it looks like it overlaps.

Sorry, but it looks messy. Can you please take another look at this?

Thanks,

Matt

Re: Scrollbar components overlap

Posted: Wed Mar 22, 2017 8:29 am
by Christopher
biqpaulson wrote: Sorry, but it looks messy. Can you please take another look at this?
I am sceptical that further improvements can be made in this area, and expressed my scepticism in the comment I added to the ticket:
The issue here is that the rounding problem (from double -> int for GDI+ pixels) will depend on the number of elements in the LegendScrollBar, meaning that the 'fix' of a pixel (an int of value '1') will not necessarily render correctly in all cases.

Re: Scrollbar components overlap

Posted: Wed Mar 22, 2017 10:37 am
by 15048900
I understand how rounding issues can cause problems, but in this case, can't you increase the gap between the line and the bottom arrow to the point where regardless of how it rounds it will contain at least 1 pixel of space? I don't care if you have make it 5 pixels of gap, as long as the top doesn't have overlap. It's really the fact that the top looks so different than the bottom. Does this make sense?

Thanks

Re: Scrollbar components overlap

Posted: Thu Apr 06, 2017 3:06 pm
by 15048900
Hello:

Have you had a chance to look my comments below? Do you this it would be possible to resolve this issue?

Thanks!

Re: Scrollbar components overlap

Posted: Fri Apr 07, 2017 8:34 am
by Christopher
biqpaulson wrote: Have you had a chance to look my comments below? Do you this it would be possible to resolve this issue?
Using the .NET 4.0 version of the TeeChart.dll from the latest version and the following code:

Code: Select all

    private void InitializeChart()
    {
      Line series = new Line(tChart1.Chart);
      series.FillSampleValues(100);

      LegendScrollBar tool = new LegendScrollBar(tChart1.Chart);
    }
I obtain the following:
TChart636271499129401761.png
TChart636271499129401761.png (38 KiB) Viewed 23141 times
from what I understand the problematic rendering should occur within the two yellow circles, but in my view the placement of the arrows seem correct, or rather, are symmetrical and non-overlapping.

Re: Scrollbar components overlap

Posted: Fri Apr 07, 2017 12:21 pm
by 15048900
Hi Chris:

OK -- I found the difference. Please add this single line to your test case and you will see the difference:

.scrollBar.Size = 14

Also, even with the size left to the default setting, if you move the thumb to the top and then the bottom, you will see a difference in how the thumb overlaps the top and bottom arrows. I can understand why changing the size would affect your scaling (you have mentioned this before), but I don't see why, at the default size, it shouldn't look perfect.

Thanks,

Matt

Re: Scrollbar components overlap

Posted: Wed Apr 12, 2017 7:46 am
by Christopher
Hello Matt,
biqpaulson wrote: I can understand why changing the size would affect your scaling (you have mentioned this before), but I don't see why, at the default size, it shouldn't look perfect.
Okay, here is some sample code:

Code: Select all

  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
      CreateChart();
      InitializeChart();
    }

    TChart tChart1 = new TChart();

    private void CreateChart()
    {
      //tChart1.Dock = DockStyle.Fill;
      splitContainer1.Panel2.Controls.Add(tChart1);
    }

    LegendScrollBar tool;

    private void InitializeChart()
    {
      Line series = new Line(tChart1.Chart);
      series.FillSampleValues();

      tool = new LegendScrollBar(tChart1.Chart);
    }

    private void button2_Click(object sender, EventArgs e)
    {
      tool.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
      tool.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
    }

    private void button1_Click(object sender, EventArgs e)
    {
      tChart1.Export.Image.PNG.Save(@"D:\FTP\" + "TChart" + DateTime.UtcNow.Ticks.ToString() + ".png");
    }
  }
And here is a screenvideo of what is looks like here:
https://www.screencast.com/t/WfdfmP2EGIH

this is as close as I can get to a 'default' chart with a LegendScrollBar - could you please be so kind as to point out to me where you see the imperfections you mention?

Re: Scrollbar components overlap

Posted: Wed Apr 12, 2017 12:37 pm
by 15048900
Hello:

For your example, please look at these two images:
top.PNG
top.PNG (847 Bytes) Viewed 23107 times
bottom.PNG
bottom.PNG (916 Bytes) Viewed 23108 times
Do you see the difference? There is overlap of the center (movable) area on the bottom but not on the top -- BUT -- I understand why this is happening in your case: The area over overlap is part of the 3d effect of the rendering of the movable part of the scrollbar (the beveled edge).

BUT -- I am choosing no bevel:

ChartTag.Settings.scrollBar.Bevel.Inner = BevelStyles.None
ChartTag.Settings.scrollBar.Bevel.Outer = BevelStyles.None

In which case there should be no bevel, and a simple border around that part of the control. But that is not case, part of the bevel is still visible.

Does this make sense?

Thanks

Re: Scrollbar components overlap

Posted: Wed Apr 12, 2017 12:55 pm
by Christopher
Hello Matt,
biqpaulson wrote: Does this make sense?
if I'm not mistaken, this is the same as id=1792. Again, although I'm sure it is not immediately obvious without access to the source code (and even with the source code, it isn't necessarily so), the fact that LegendScrollBar calculations occur in System.Double means that rounding to System.Int32 for GDI+ can and does create such 'imperfect artefacts'.

Re: Scrollbar components overlap

Posted: Wed Apr 12, 2017 1:30 pm
by 15048900
Hi Chris:

Yes, same issue. I can't pursue the any further right now, but if you happen to encounter this area of the code in the future and there's an opportunity to fix it, please try to.

Thanks,

Matt