|
Align gradient relative to polygon arrow marker? |
Posted by David St. John on Jan-10-2008 02:52 |
|
Hi, with ChartDirector 4.1 (php), I'm using a custom-defined polygon as an arrow marker for a vector layer on an XY chart. Using a single color it comes out as in the first image (nogradient.png).
If I use a gradientColor it looks like the second image (gradient.png), where the gradient is relative to the background instead of the polygon.
What I really want to do is shown in the third image (shop.png), which I did by hand in photoshop.
That is, I want the gradient on the arrow marker to be relative to the arrow marker, and aligned along the direction of each arrow marker. What is the best way to do that in ChartDirector?
Thanks!
|
Re: Align gradient relative to polygon arrow marker? |
Posted by Peter Kwan on Jan-10-2008 04:06 |
|
Hi David,
I only method I can think of is to use a separate gradient color for each arrow. The origin and ending (x, y) of the gradient can be set to the starting and ending point of the arrow.
Hope this can help.
Regards
Peter Kwan |
Re: Align gradient relative to polygon arrow marker? |
Posted by David St. John on Jan-10-2008 04:25 |
|
Thanks for the quick reply, Peter. That does seem like it would work, but I'm afraid it will be inefficient to calculate the coordinates of each arrow and create a gradient. I'll try it though and run some performance tests. Probably we'll just learn to live without the gradients! |
Re: Align gradient relative to polygon arrow marker? |
Posted by Peter Kwan on Jan-10-2008 15:26 |
|
Hi David,
As the arrows are drawn using polygons, I thought your code already have the coordinates of the vertices of the polygon.
For a simple linear gradient (use BaseChart.linearGradientColor), you only need to know two points - the tip of the arrow (which is one of the vertices of the polygon), and the base of the arrow (which is the average of the two vertices at the base).
Hope this can help.
Regards
Peter Kwan |
Re: Align gradient relative to polygon arrow marker? |
Posted by Peter Kwan on Jan-10-2008 15:33 |
|
Hi David,
Sorry for your last message. Please ignore it. I read your message again, and I realize the arrows are drawn by the vector layer, not by your code directly. So your code do not really know the coordinates.
Regards
Peter Kwan |
Re: Align gradient relative to polygon arrow marker? |
Posted by David St. John on Jan-10-2008 22:02 |
|
Right, I define the polygon as an array, and the vector layer draws them at each x,y point on the chart. So maybe that could be a future feature: a gradient that is relative to the polygon (same way the way gradients of the bar chart symbols are relative to the symbol).
Thanks again, Peter, for your excellent product and support.
David |
Re: Align gradient relative to polygon arrow marker? |
Posted by Peter Kwan on Jan-11-2008 03:46 |
|
Hi David,
Thank you very much for your suggestion. We will consider "relative gradient" support in the next version of ChartDirector. (Actually, we have been thinking about this for a long time. I hope this feature can get implemented into the next version.)
Regards
Peter Kwan |
Re: Align gradient relative to polygon arrow marker? |
Posted by Andrzej Jasionowski on Feb-02-2017 00:30 |
|
Morning/Evening Peter,
Has this fill-coloring in polygon based on colors at each corner point ever been implemented? I cannot find anything in the help files beyond the linearGradientColor2 methods (based on start and end vortices only)? Would appreciate your help.
Best regards
Andrzej |
Re: Align gradient relative to polygon arrow marker? |
Posted by Peter Kwan on Feb-03-2017 02:19 |
|
Hi Andrzej,
Unluckily, this feature was eventually not implemented, so the gradient would still need to be created arrow by arrow. We think in practice, the code would not be to complicated, as basically you only need to write the code for one arrow, then use a loop to repeatedly run the code for multiple arrows.
Regards
Peter Kwan |
|