|
Load pattern to bars |
Posted by Claudio Weber Abramo on Jun-30-2013 22:25 |
|
Dear Peter:
Sorry to bother you with this, but I can't find in the documentation how to load a custom pattern (a png image) into a bar layer (setBarShape2 or 3).
Thanks. |
Re: Load pattern to bars |
Posted by Peter Kwan on Jul-02-2013 00:55 |
|
Hi Claudio,
You may define a "pattern color" using a custom image. The pattern color can then be just like a normal code. You may use it as the bar color if you like. The sample code "Pattern Area Chart" illustrates how to use "pattern color". (This example use the color for an area chart, but you can use the same color for a bar chart as weill.)
For example:
$myColor = $c->patternColor2(dirname(__FILE__)."/myCustomImage.png");
$c->addBarLayer($myData, $myColor);
Hope this can help.
Regards
Peter Kwan |
Re: Load pattern to bars |
Posted by Claudio Weber Abramo on Jul-02-2013 05:18 |
|
Dear Peter:
Thank you. Actually, I have done what you point out.
Since we are on this matter, it would be nice to be able to define a fill pattern from a string (without juxtaposing text boxes upon a chart's bars). It would be handy for SVG graphs.
Regards |
Re: Load pattern to bars |
Posted by Peter Kwan on Jul-02-2013 23:00 |
|
Hi Claudio,
If we define a "pattern" by a string, then we need to invent another language that can be used to described the pattern. Whereas using SVG as the pattern definition language works well for SVG, it is unlikely to work for other output formats that ChartDirector needs to support.
So from our point of view, using a textual description of a pattern would be rather complicated. If we were to implement this feature, we probably would invent a simple language that can easily be translated to the output formats that we need to support.
Regards
Peter Kwan |
Re: Load pattern to bars |
Posted by Claudio Weber Abramo on Jul-02-2013 23:41 |
|
Hi Peter:
Fair enough.
Cheers,
Claudio |
|