Pattern per point

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
Jim Green
Newbie
Newbie
Posts: 6
Joined: Mon Jul 21, 2014 12:00 am

Pattern per point

Post by Jim Green » Mon Jun 01, 2015 5:43 pm

Hi, I need to show a pattern whose color is different for each point. Can this be done?

Thanks.

Jim Green
Newbie
Newbie
Posts: 6
Joined: Mon Jul 21, 2014 12:00 am

Re: Pattern per point

Post by Jim Green » Mon Jun 01, 2015 5:44 pm

PS. I should have said that this is a Bar series.

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Pattern per point

Post by Marc » Tue Jun 09, 2015 9:22 am

Hi,

One approach could be to set the Bar's render style as image.

for example (taken from TeeChart's demos\series\bar\bar.htm example):

Code: Select all

Chart1.series.items[0].format.image.url="../../images/diag.png";
Here I have changed the default .jpg image to a .png image that supports transparency (optional possibility) and where the .png image represents a pattern.

Regards,
Marc
Steema Support

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Pattern per point

Post by Marc » Thu Jun 11, 2015 10:47 am

Hello,

As a followup on this point, pattern repeat has just been added to the image fill style for BarSeries to permit homogenous pattern repeat/tile across different bar sizes.

Regards,
Marc
Steema Support

Jim Green
Newbie
Newbie
Posts: 6
Joined: Mon Jul 21, 2014 12:00 am

Re: Pattern per point

Post by Jim Green » Thu Jun 11, 2015 10:05 pm

Marc, I am using an image (that's what I meant by pattern). What I need is a different pattern per-point. E.g. a red hatch for one point and a blue hatch for another.
Here I have changed the default .jpg image to a .png image that supports transparency
I am already controlling color per-point. Are you saying that I can use one pattern for series 1 and another pattern for series 2, and each point's color will show through at the png's transparent areas? If so, that's exactly what I need (one pattern per series but colored per point).

Thanks, Jim

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Pattern per point

Post by Marc » Fri Jun 12, 2015 10:34 am

Hello Jim,

I hadn't thought of it in that way, to provide the point colour as background to the transparent pattern. Default behaviour would be to show transparency through to the chart background.

But I've modified the TeeChart code to offer the option you describe and have emailed you the test file with example. We'll incorporate the change into the next update release.

Regards,
Marc
Steema Support

Jim Green
Newbie
Newbie
Posts: 6
Joined: Mon Jul 21, 2014 12:00 am

Re: Pattern per point

Post by Jim Green » Fri Jun 12, 2015 7:29 pm

Marc, this works perfectly. Thanks so much!

Jim

Post Reply