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)
Chart Series Palette for empty records
easyleads
<p>Hi,</p>
<p> </p>
<p>I have a problem with the Pie Chart or Scatter Chart color series palette:</p>
<p> </p>
<p>What I wish to achieve is have the <strong>same</strong> color for a certain category of the chart when not all categories must exist to begin with (in several runs of the report) .</p>
<p> </p>
<p>Example -</p>
<p> </p>
<p>I have 3 types - A (Green),B (Red) and C (Blue). Series Palette is set up - Green,Red and then Blue.</p>
<p>One generation of the report may have all 3 items in the chart so the colors and the legend are OK.</p>
<p>A second generation can have only A,C groups -> As a result the C group will get the Red color (being second in the series palette).</p>
<p>To solve this I must add an empty 0 valued record for group B - not very nice and professional.</p>
<p> </p>
<p>Anyway to solve this without adding the artificial 0 entry?</p>
<p> </p>
<p>Thanks.</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>You can use chart scripting to control the color of each series. In the attached example, I have added script to the <em><strong>beforeDrawDataPoint </strong></em>and <em><strong>beforeDrawLegendItem </strong></em>methods to set the color of the series item based on its value. If you run the report, you will get a pie chart with 3 product lines displayed using the default palette. You can then modify the query and remove one product line: the series items that are left will keep the same colors.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
easyleads
<p>Thank you.</p>
<p> </p>
<p>This does the trick.</p>