Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Conditional styling/formatting Axis Labels in HTML5 charts
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Conditional styling/formatting Axis Labels in HTML5 charts
 Login/Join
 
Platinum Member
posted
Hi All,

How do you conditionally style/format an axis label when creating a HTML5 chart?

This turns all x axis values red ...

*GRAPH_JS
xaxis: {labels: {color: 'red', font: 'bold 12pt Bookman Old Style'}}
*END


But how can you turn only some red depending on some condition?

Thanks

This message has been edited. Last edited by: FP Mod Chuck,


WebFocus 8.201M, Windows, App Studio
 
Posts: 221 | Location: Lincoln Nebraska | Registered: August 12, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
You can use javascript to do some manipulation.

e.g.
GRAPH FILE CAR
SUM SALES
BY COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH LINE
ON GRAPH SET STYLE *
*GRAPH_JS
border: {width:0},
series: [{series: 'all', marker: {shape: 'circle'}}],
  xaxis: {
    labels: {
     font: 'bold 10pt Bookman Old Style',
     color: function(val){
      switch(val) {
       case 'ENGLAND':
        return 'blue';
        break ;
       case 'FRANCE':
        return 'red';
        break ;
       default:
        return 'green';
        break ;
      }
     }
    }
   },
  yaxis: {
    labels: {font: 'bold 10pt Bookman Old Style',color: 'blue'}}    
*END
ENDSTYLE
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6119 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi Waz ... Thanks for the example, but when I run your code ... all the COUNTRY values are blank. What needs to be changed to make this work? Does that code work for you?


WebFocus 8.201M, Windows, App Studio
 
Posts: 221 | Location: Lincoln Nebraska | Registered: August 12, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
Code works for me unchanged in 8.2.04. In 8.2.01 there seems to be an issue so I would suggest a case with tech support?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5606 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Code works for me in 8.1.04, but does not on 8.2.05.

Perhaps this is an undocumented feature or a Bug ??


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6119 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Waz,

Works for me OK in 8.2.05 gen 12212018.

The only version that I saw issues was 8.2.01

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5606 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Gen date for my 8.2.05 is
24 Feb 2019 (Client)
21 Feb 2019 (Server) GEN_NUM = 1535


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6119 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Mine is currently
Client 12th Oct 2018 Build/Gen 13
Server 8th Oct 2018 Gen 1518

Will be updating to Gen 1542 (client 15) later hopefully and also building VM for 8.2.06 Gen 1732

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5606 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Works on
- 8205 - client Build/Gen 104 server Gen 1542 which are the latest for 8.2.05

- 8206 - client Build/Gen 22 server Gen 1732 - latest for 8206

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5606 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Bugger,

don't want to upgrade if I can avoid it.

Guess I was unlucky in the version I downloaded.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6119 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Conditional styling/formatting Axis Labels in HTML5 charts

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.