Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
beforeDrawDataPoint, setting color problem
BugMeNot21
I have a dataset with started(datetime), finished(datetime) and status(string) obtained from database.
I need to color the gantt chart boxes based on status but i am unable to find a connection between the DataPointHint and the row['status']. I have set up a parallel key/value map as global variable which is filled in within OnFetch but as it seemed logical that DataPointHint getIndex would match the row in dataset but unfortunately this doesnt match.
The only "usefull" value I get within datapoint hint is something like:
"SApr 30, 2013 3:00:05 AM EApr 30, 2013 3:08:14 AM Status"
which is a pain to create with javascript. The getBaseDisplay value is useless as i am having multiple time periods on same row on chart.
Any help would be appreciated:(
Find more posts tagged with
Comments
kclark
I was able to do this using the following script<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>function beforeDrawDataPoint( dph, fill, icsc )
{
if( dph.getBaseDisplayValue() == "Cancelled"){
fill.set(255,0,0);
}
if( dph.getBaseDisplayValue() == "Shipped"){
fill.set(255,255,0);
}
if( dph.getBaseDisplayValue() == "Resolved"){
fill.set(127,255,0);
}
}
</pre>
<br />
I've attached an example, I wrote this in 4.2.2. Let me know if you need it in another version
BugMeNot21
This would be just too easy... I have multiple time periods on same line, so each Y value can have multiple time periods and each can have its own status. As such base display value cant be used...