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     [SOLVED] Styling on Trend Lines
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Styling on Trend Lines
 Login/Join
 
Member
posted
Hi all,

Is it possible to style a trend line independently of the series? When I try to specifically change the color of a trend line it changes the entire series to match.

We have a requirement where the trend line should be made a shade of grey so the main line is emphasized over the trend line.

I found this thread: http://forums.informationbuild...1057331/m/5647099966

But the solution did not do anything to my trend lines.

I should mention I'm using version 8201 and App Studio.

Thanks,
Matthew

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 8 | Registered: October 03, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
What is the chart format ?

JSCHART ?


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: 6272 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Hi Waz,

Yes, it's a JSCHART.

ON GRAPH PCHOLD FORMAT JSCHART


WebFOCUS 8
Windows, All Outputs
 
Posts: 8 | Registered: October 03, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
Have a look at the documentation on JSCHART reference Lines

wfjschart82

You are on 8.2 ?


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: 6272 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Hi Waz,

Yes, I'm on 8.2.

Just to clarify, I'm not trying to add a reference line, I'm trying to get a linear trend line and then style it independently from the line graph it is showing the trend of. Correct me if I'm wrong, but it seems like reference lines can only be static horizontal and vertical lines.


Below is the style portion of my chart. I tried using the trend line syntax just below the reference line text but was not able to get a trend line to appear. When I add a trend line through the UI, it adds the two lines that are bolded below. I commented them out so I could verify that the new syntax is working, but I'm not able to get the trend line to appear.


ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
-*setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setLabelStagger(getO1Label(),false);
setTextRotation(getO1Label(),0);
-*setCurveFitType(0,1);
*GRAPH_JS_FINAL
"trendline": {
"enabled": true,
"mode": 'linear',
"line": {"width": 2, "color": 'black', "dash": '' },
"equationLabel": { "visible": false, "color": 'black', "mode": 'equation' }
},
"pieProperties": {
"holeSize": "0%"
},
"blaProperties": {
"seriesLayout": "absolute"
},
"agnosticSettings": {
"chartTypeFullName": "Line_Absolute"
},
"xaxis": {
"title": {
"visible": false
}
}
*END
ENDSTYLE
END
-RUN


WebFOCUS 8
Windows, All Outputs
 
Posts: 8 | Registered: October 03, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
Apologies, meant to type trend, got reference on the brain.

So the trend line appears when those two line are in the chart ?


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: 6272 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
It's this line that controls if the trend line appears:

setCurveFitType(0,1);

The other line simply controls if the equation for the line appears on the chart depending if it's set to true or false:

setCurveFitEquationDisplay(false);

Regardless, even when I include "setCurveFitType", the trend line styling code copied above does not affect how it is displayed.


WebFOCUS 8
Windows, All Outputs
 
Posts: 8 | Registered: October 03, 2017Reply With QuoteReport This Post
Member
posted Hide Post
Hi,

Any advice on this matter would be very helpful!

Thanks,
Matthew


WebFOCUS 8
Windows, All Outputs
 
Posts: 8 | Registered: October 03, 2017Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This has worked for me in version 8.2.01. Changed the trend line color to red.
*GRAPH_JS
series: [
{series: 0, trendline: { lineStyle: {color: 'red'} } }
]
*END


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Sample with car file.

ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setFillType(getSeries(0),2);
setGradientPinPosition0(getSeries(0),0.0);
setGradientPinPosition1(getSeries(0),1.0);
setTransparentBorderColor(getSeries(0), true);
setCurveFitType(0,1);
setFillColor(getSeries(0),new Color(255,0,0));
*END
*GRAPH_JS
series: [
{series: 0, trendline: { lineStyle: {color: 'blue'} } }
]
*END
ENDSTYLE
END
-RUN


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Reply With QuoteReport This Post
Member
posted Hide Post
Thank you Spence!

This works, but only after I delete all of the other properties in the *GRAPH_JS_FINAL section of the code I posted above.


WebFOCUS 8
Windows, All Outputs
 
Posts: 8 | Registered: October 03, 2017Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Styling on Trend Lines

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