Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report 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.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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-2020 Information Builders