Focal Point
[SOLVED] WF8 HTML5 graph templates

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8307017276

September 17, 2014, 02:38 PM
Hans
[SOLVED] WF8 HTML5 graph templates
This is for WebFOCUS 8 HTML5 graph question. Is there a way to select a template or customize the bar colors in a graph? If I have 20 or more legends, the colors starts to look alike.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
September 18, 2014, 05:29 AM
Tony A
Hi Hans,

When you are creating your chart using the GUI in WF8, on the home tab there is a "theme" button. This will allow you to choose a predefined theme - either sample or custom.

If you look at the ENBlue_theme.sty file (for example) you will see that there are 64 series colours declared.

If you wish to use your own then I would suggest using one of the samples as a base. Copy it to your app folder and makes changes.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 23, 2014, 01:49 PM
Hans
Thank you! That worked!


WebFOCUS 7.6
Windows, All Outputs
September 24, 2014, 09:08 PM
David Briars
Thought I would add to this great thread, as I've been looking at this type of thing as well.

I found a very interesting Stack Exchange article on color differentiation here: http://graphicdesign.stackexch...y-datasets-on-a-plot
http://graphicdesign.stackexch...com/revisions/3815/8

Accordingly, here is a scenario, where we call our standard stylesheet, that comes with WFDS, but then override the series colors, using the hex codes from stack exchange:
DEFINE FILE GGSALES
 AMOUNT/I5 = 100;
END
-*
GRAPH FILE GGSALES
 SUM AMOUNT   AS 'Amount'
 BY  SEQ_NO   AS 'Sequence'
 IF  SEQ_NO   LE 22
 ON GRAPH PCHOLD FORMAT JSCHART
 ON GRAPH SET LOOKGRAPH VBAR
 ON GRAPH SET AUTOFIT ON
-*
ON GRAPH SET STYLE *
INCLUDE = ENgradient_combine, $
*GRAPH_SCRIPT
 setColorMode(2);
*END
-* Maximally Distinct Colors from Stack Exchange Graphic Design.
*GRAPH_SCRIPT
 setFillColor(getSeries(0),new Color(#FFFF00));
 setFillColor(getSeries(1),new Color(#1CE6FF));
 setFillColor(getSeries(2),new Color(#FF34FF));
 setFillColor(getSeries(3),new Color(#FF4A46));
 setFillColor(getSeries(4),new Color(#008941));
 setFillColor(getSeries(5),new Color(#006FA6));
 setFillColor(getSeries(6),new Color(#A30059));
 setFillColor(getSeries(7),new Color(#FFDBE5));
 setFillColor(getSeries(8),new Color(#7A4900));
 setFillColor(getSeries(9),new Color(#0000A6));
 setFillColor(getSeries(10),new Color(#63FFAC));
 setFillColor(getSeries(11),new Color(#B79762));
 setFillColor(getSeries(12),new Color(#004D43));
 setFillColor(getSeries(13),new Color(#8FB0FF));
 setFillColor(getSeries(14),new Color(#997D87));
 setFillColor(getSeries(15),new Color(#5A0007));
 setFillColor(getSeries(16),new Color(#809693));
 setFillColor(getSeries(17),new Color(#1B4400));
 setFillColor(getSeries(18),new Color(#4FC601));
 setFillColor(getSeries(19),new Color(#3B5DFF));
 setFillColor(getSeries(20),new Color(#4A3B53));
 setFillColor(getSeries(21),new Color(#FF2F80));
*END
ENDSTYLE
END
-RUN 






Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster