Brendan Yano Posted September 24, 2021 Share Posted September 24, 2021 Hi I have a simple pie chart that is reporting on data that in development had 4 status: Series 0 - ME, Series 1 - No, Series 2 - REF, Series 3 -Yes so I set the series to have the appropriate colours using Designer and it generated the code listed below. As you can see each series is only identified by the numeric value. However in production that data source currently only has 2 (No, Yes) of the 4 status as we dont have any responses that generate the other two (ME,REF) So it is setting No to series 0, and Yes to series 1 which is causing the values to have the incorrect colours. Is there a way to edit the code to be specific to the actual values and keep the correct colours defined in DEV even when some of the other status do not currently exist. I know I could edit the series in prod so that yes and no are back to the correct colours but then I will have to edit them again when we receive responses that generate ME and REF. Thanks GRAPH_JS_FINAL series: [ { dataLabels: { visible: true, position: auto, content: {{auto_percent}}, font: 22pt Sans-Serif }, series: all }, { dataLabels: { visible: true, position: outside, content: {{auto_percent}}, font: 16pt Sans-Serif }, color: rgba(163, 73, 164, 1), series: 0 }, { dataLabels: { visible: true, position: outside, content: {{auto_percent}}, font: 16pt Sans-Serif }, color: rgba(237, 28, 36, 1), series: 1 }, { dataLabels: { visible: true, position: outside, content: {{auto_percent}}, font: 16pt Sans-Serif }, color: rgba(255, 242, 0, 1), series: 2, explodeSlice: 0.0 }, { dataLabels: { font: 16pt Sans-Serif }, color: rgba(34, 177, 76, 1), series: 3, explodeSlice: 15.0 } ], pieProperties: { holeSize: 65% } *END ENDSTYLE Link to comment Share on other sites More sharing options...
SATHEESH B Posted September 29, 2021 Share Posted September 29, 2021 Series color is set in the order 0,1,2,3 if there is a missing or 0 value the order will not remain the same. So try to include missing and 0 Labels . it will retain the colors. image.png1381607 178 KB Link to comment Share on other sites More sharing options...
Brendan Yano Posted September 29, 2021 Author Share Posted September 29, 2021 Hi Satheese, Thank you for the reply but unfortunately its not just a zero label, but those values do not exist in the data at all so there is nozero label that I can enable. Also, that feature is in InfoAssist and I am looking to do this in designer. Link to comment Share on other sites More sharing options...
Brendan Yano Posted September 29, 2021 Author Share Posted September 29, 2021 In case other people have encountered this, I was able to work with an Tibco resource today (thank you Dirk!) who was able to provide with a method to code this in designer (see below) they also let me know this functionality is available through the GUI in the latest release of Designer with conditional styling which functions much the same as the traffic light option in IA. INCLUDE=IBFS:/WFC/Global/Themes/Standard/Default/theme.sty,$ TYPE=REPORT, TITLETEXT=Chart1, ORIENTATION=LANDSCAPE, ARREPORTSIZE=DIMENSION, ARFILTER_TARGET=*, ARGRAPHENGINE=JSCHART, $ TYPE=DATA, COLUMN=N1, BUCKET=color, $ TYPE=DATA, COLUMN=N2, BUCKET=measure, $ TYPE=DATA, COLUMN=N2, WHEN=N1 EQ ME, COLOR=RGB(163 73 164), $ TYPE=DATA, COLUMN=N2, WHEN=N1 EQ No, color=RGB(237 28 36), $ TYPE=DATA, COLUMN=N2, WHEN=N1 EQ REF, color=RGB(0 0 0) , $ TYPE=DATA, COLUMN=N2, WHEN=N1 EQ Yes, color=RGB(34 177 76), $ *GRAPH_SCRIPT *GRAPH_JS_FINAL series: [ { dataLabels: { visible: true, position: outside, content: {{metadata_value(default, dataLabels)}}, font: 28pt Sans-Serif }, series: all } ], pieProperties: { holeSize: 65% } Link to comment Share on other sites More sharing options...
Toby Mills Posted September 30, 2021 Share Posted September 30, 2021 Yep - WHEN is the ticket. Ive seen this pop up before and wondered if there were some additional parts we might add to the metadata (perhaps in the .acx file) that specifies colors for literal values. I had a railroad customer once who was watching several railroads with graphs - the usual suspects like Union Pacific, Sante Fe, Burlington etc. We were able to use WHENs to make it so the graphs stayed consistent in their colors. Just seems like there might be a way of specifying the colors in the master/acx descriptions to make it stay the same all the time. We just made a -INCLUDE that for that customer that had the code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now