Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
How to dynamicaly change the fill color of an AREA chart
Migrateduser
Hello, <br />
I'm searching for a clue for 24 hours now.. <br />
I need to change the color of an area in a 4 series area chart, depending on the name of the serie. <br />
<br />
I already know how to : <br />
- use the <strong class='bbc'>beforeDrawDataPoint</strong>( dph, fill, icsc ) to change pie chart / Bar chart color depending on the serie name<br />
beforeDrawDataPoint( dph, fill, icsc )<br />
{<br />
var sValue = dph.getBaseDisplayValue(); // or getSerieDisplayValue();<br />
if (sValue == "Comptoir"){<br />
fill.getStartColor().set(254,254,0);<br />
fill.getEndColor().set(255,255,128);<br />
}<br />
<br />
- use the <strong class='bbc'>beforeDrawLegendItem</strong>( lerh, bounds, icsc ) to change the legend color..;<br />
{<br />
var label = lerh.getLabel();<br />
var sValue = label.getCaption().getValue();<br />
if (sValue == "Comptoir"){<br />
lerh.getFill().getStartColor().set(254,254,0);<br />
lerh.getFill().getEndColor().set(255,255,128);<br />
}<br />
etc...<br />
<br />
but why on earth does it not work with area charts ? How can I do that ? <br />
I found how to get the serie name.. int<br />
function <strong class='bbc'>beforeDrawSeries</strong>( series, isr, icsc )<br />
{<br />
var myName = series.getSeriesIdentifier();<br />
<br />
But I'm totally stuck there. <br />
<br />
Do someone have a solution ?<br />
(please take into consideration that I need to get some specific colors for specific series, as my clients might not get all series at the same time. Sometimes no serie 1, some other : no serie 2.. But everytime a serie 1 pops out, I need it to be in red. )<br />
<br />
Any help would be highly appreciated (even if it is a redirection to a book that holds the solution.)<br />
<br />
regards, <br />
Roland
Find more posts tagged with
Comments
There are no comments yet