Page 1 of 1

Bar patterns

Posted: Tue Aug 12, 2014 4:14 pm
by 9347097
Hello, I'm using the latest (?) v1.7 July 2014 teechart.js. I believe this includes a fix to http://bugs.teechart.net/show_bug.cgi?id=831, involving patterns in bar series. While the image does appear, it is stretched to the bar rectangle. An image needs to be tiled to serve as a pattern. Is this something that can be done?

Also, in VCL, a two color, B&W pattern displays with the series colors. If this is not possible, I can create a pattern per-color, though this is obviously extra work.

I can provide a sample if you need it.

Thanks.

Re: Bar patterns

Posted: Wed Aug 13, 2014 3:03 pm
by yeray
Hello,
Jim Green wrote:I'm using the latest (?) v1.7 July 2014 teechart.js. I believe this includes a fix to http://bugs.teechart.net/show_bug.cgi?id=831, involving patterns in bar series. While the image does appear, it is stretched to the bar rectangle. An image needs to be tiled to serve as a pattern. Is this something that can be done?
I see. I've reopened the ticket and added a comment to it so it can be revised.
Jim Green wrote:Also, in VCL, a two color, B&W pattern displays with the series colors. If this is not possible, I can create a pattern per-color, though this is obviously extra work.
I've added a new ticket to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=885

Re: Bar patterns

Posted: Wed Aug 13, 2014 4:34 pm
by 9347097
Thanks.

FWIW, I added tiling by adding a "style" property to ChartImage and using createPattern/fill when style is "repeat" (instead of drawImage). Source attached.

Note that it also allows repeat-x, repeat-y and no-repeat, though only "repeat" works. Maybe you'll spot why - I'm a complete noob at Canvas drawing.

(I also disabled "hassymbol" in Legend to allow symbols to show in more cases.)

Jim.

Re: Bar patterns

Posted: Thu Aug 14, 2014 2:16 pm
by yeray
Hi Jim,

I've removed the attachment because it contained the source code of TeeChart.
However, I downloaded it first and I'll post it in the ticket B831 as a private comment so it can be studied for implementation in next releases.

Re: Bar patterns

Posted: Thu Aug 14, 2014 2:43 pm
by 9347097
Sorry! Should have thought of that...

Re: Bar patterns

Posted: Thu Aug 14, 2014 2:49 pm
by yeray
Hi Jim,
Jim Green wrote:Sorry! Should have thought of that...
No problem!
And thanks for sharing the fix proposal!