Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function drawLine() fails to heed setSerieWeight() if not anti-aliased nor setSerieTicks() used #64

Open
Lerrissirrel opened this issue Apr 12, 2020 · 1 comment

Comments

@Lerrissirrel
Copy link

I'm placing this here more for anyone who comes after me than to expect a solution.

It appears that, for whatever reason, drawLine() ignores setSerieWeight() if neither anti-aliasing nor a dashed (ticks) line are requested. My best guess is that the author thought that thick lines looked bad without these settings. Or it could have just been an oversight.

There's an old question about this on the "official" (dead?) pChart forum: http://wiki.pchart.net/forum/viewtopic.php?f=5&t=2316&hilit=setserieweight

I found no harm when commenting out this clause in drawLine() to let it fall through to the code that handles the weight.

if ( $this->Antialias == FALSE && $Ticks == NULL )
      {
       if ( $this->Shadow && $this->ShadowX != 0 && $this->ShadowY != 0 )
        {
         $ShadowColor = $this->allocateColor($this->Picture,$this->ShadowR,$this->ShadowG,$this->ShadowB,$this->Shadowa);
         imageline($this->Picture,$X1+$this->ShadowX,$Y1+$this->ShadowY,$X2+$this->ShadowX,$Y2+$this->ShadowY,$ShadowColor);
        }

       $Color = $this->allocateColor($this->Picture,$R,$G,$B,$Alpha);
       imageline($this->Picture,$X1,$Y1,$X2,$Y2,$Color);
       return(0);
      }
@szymach
Copy link
Owner

szymach commented Apr 13, 2020

Hey, how about you create a PR with a test case, where you specifically provide this certain parameters set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants