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)
How define chart colors
denislagod
Hi everybody!
I have a DataSet : Name, Value, Color
Building a chart I need to draw each region using predefined colors in DataSet.
Thank you in advance,
Denis
Find more posts tagged with
Comments
mwilliams
In your onFetch script of your dataSet, set a persistentGlobalVariable, named after the "Name" field, with the "Color" field as the value. Then, in your chart script (beforeDrawDataPoint), you can recall the color that the field is supposed to be colored by taking the base axis value and checking the value of the persistentGlobalVariable with that name and setting the color based on that value.
Hope this helps. Let me know if you have questions.
denislagod
Yes I found how to do it/<br />
Strange way - I had to create an arrays of colors (copy of dataset) and then using global counter go through it.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="98795" data-time="1334091797" data-date="10 April 2012 - 02:03 PM"><p>
In your onFetch script of your dataSet, set a persistentGlobalVariable, named after the "Name" field, with the "Color" field as the value. Then, in your chart script (beforeDrawDataPoint), you can recall the color that the field is supposed to be colored by taking the base axis value and checking the value of the persistentGlobalVariable with that name and setting the color based on that value.<br />
<br />
Hope this helps. Let me know if you have questions.<br /></p></blockquote>
mwilliams
Great! The persistentGlobalVariable way I described will allow you to just recall a PGV by the axis value, but if you've got something working, there's no reason to mess with it, now!