Focal Point
[CLOSED] X-Axis Label Repeating

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

December 15, 2016, 02:49 PM
Enigma006
[CLOSED] X-Axis Label Repeating
Hello

This is final graph request I have and I am getting year repeated on X-axis LABEL and I want it to appear only once.
I get each year 3 times... 1990 1990 1990 1991 1991 1991 etc... I just want that to be 1990 1991 1992 etc.
Also, reference line in the graph is a dotted line. It appears dotted if graph is PNG. But if its a PDF, it appears as solid line.
I tried many ways but it stays solid when format it PDF.
Please suggest if I am missing something.

TABLE FILE DATAFILE
SUM
	SALE_VALUE
BY SERIES_SORTED_VALUE
BY YEAR_VALUE
BY MONTH_VALUE 
ON TABLE HOLD AS GR_DATA
END

GRAPH FILE GR_DATA
SUM
	 SALE_VALUE
BY HIGHEST SERIES_SORTED_VALUE
ACROSS YEAR_VALUE
ACROSS MONTH_VALUE NOPRINT
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO ON
ON GRAPH SET HAXIS 1100
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINE2
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *

setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(0);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
setTransparentFillColor(getFrame(),true);
setTransparentBorderColor(getFrame(),true);
setTextFormatPattern(getDataText(),"####,###");
setTextFormatPreset(getDataText(),2);
setTransparentBorderColor(getAllSeries(),true);
setAxisAssignment (getSeries (0), 1);
setAxisAssignment (getSeries (1), 1);
setAxisAssignment (getSeries (2), 1);
setAxisAssignment (getSeries (3), 0);
setAxisAssignment (getSeries (4), 1);
setAxisAssignment (getSeries (5), 1);
setAxisAssignment (getSeries (6), 1);
setAxisAssignment (getSeries (7), 1);

-*O1 Axis
setBorderColor(getO1AxisLine(),new Color(255,255,255));
setFontSizeAbsolute(getO1Label(),true);
setFontSizeInPoints(getO1Label(),9);
setPlaceResize(getO1Label(),0);
setFontStyle(getO1Label(),2);
setDisplay(getO1MajorGrid(),false);
setGridStyle(getO1MajorGrid(),0);
setTextRotation(getO1Label(),3);
setTextString(getO1Title(),"");
setO1LabelAutoSkip(2);
setO1LabelSkipBegin(1);
setO1LabelSkipCount(3);

-*Y1 Reference Line
setBorderColor(getReferenceLineY1(0),new Color(0,0,0));
setFillColor(getReferenceLineTextY1(0),new Color(255,0,0));
setDisplay(getReferenceLineY1(0),true);
setLineBasicStrokeType(getReferenceLineY1(0),16);
setReferenceLineValueY1(0,4);
setDisplay(getReferenceLineTextY1(0),true);
setReferenceTextPosition(getReferenceLineTextY1(0),2);

ENDSTYLE
END  


Thanks

This message has been edited. Last edited by: Tamra,


8.1.05
HTML,PDF,EXL2K, Active, All
December 16, 2016, 06:30 AM
MartinY
Try this to have it group by YEAR_VALUE instead of SERIES_SORTED_VALUE
BY SERIES_SORTED_VALUE NOPRINT
...
ON GRAPH SET GRXAXIS 2


For your reference line, try to change its format to dashes or dots instead of "many dots". The problem may be due to fact that HTML vs PDF doesn't return the same quality of resolution.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
December 16, 2016, 09:23 AM
Enigma006
Martin

Those did not work. Still year appears multiple times and line is solid. I tried all options (dots..dashes..etc) available from the tool but line appears solid on PDF.

Thanks


8.1.05
HTML,PDF,EXL2K, Active, All
December 16, 2016, 10:37 AM
MartinY
YEAR_VALUE will be repeated as many time SERIES_SORTED_VALUE have value.
If you have 3 different values in SERIES_SORTED_VALUE, YEAR_VALUE will be repeated 3 times.

You group the year and month BY the SERIES_SORTED_VALUE so they will be repeated for each break of SERIES_SORTED_VALUES.

Look at your data with a regular report first, you may be then able to see how it result
TABLE FILE GR_DATA
SUM SALE_VALUE
BY HIGHEST SERIES_SORTED_VALUE
ACROSS YEAR_VALUE
ACROSS MONTH_VALUE
END


It's also difficult to help you since we don't know your data and expected result. Can you reproduce using car file ?

Mine display dash, dots...etc, without any issue
-SET &TRHOLD = 22000;

DEFINE FILE CAR
REGION /A10 = DECODE COUNTRY ('FRANCE' 'East' 'ITALY' 'East' 'ENGLAND' 'East' 'W GERMANY' 'West' 'JAPAN' 'West');
END
GRAPH FILE CAR
SUM SALES       AS 'Sales'
BY REGION  NOPRINT
BY SEATS AS '' 
BY COUNTRY
ON GRAPH PCHOLD FORMAT PDF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 870
ON GRAPH SET VAXIS 605
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINE2
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 2
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setTransparentBorderColor(getChartBackground(),true);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setGridStepAuto(getY1MajorGrid(),false);
setDisplay(getY2AxisLine(),true);
setDisplayOffScale(getY2Axis(),true);
setLineWidth(getY1MajorGrid(),0);
setDisplay(getY1MinorGrid(),false);
setDisplay(getY1MajorGrid(),true);
setFontSizeAbsolute(getO1Label(),true);
setFontSizeInPoints(getO1Label(),10);
setDisplay(getO1Label(),true);
setDisplay(getY1Label(),true);
setPlace(false);
setDepthRadius(0);
setDepthAngle(0);
setLineWidth(getReferenceLineY1(0),1);
setFillColor(getReferenceLineY1(0),new Color(0,0,0));
setBorderColor(getReferenceLineY1(0),new Color(255,0,0));
setFillColor(getReferenceLineTextY1(0),new Color(255,0,0));
setDisplay(getReferenceLineY1(0),true);
setLineBasicStrokeType(getReferenceLineY1(0),14);
setReferenceLineValueY1(0,&TRHOLD);
setTextString(getReferenceLineTextY1(0),"Threshold");
setDisplay(getReferenceLineTextY1(0),true);
setReferenceTextPosition(getReferenceLineTextY1(0),2);
setDisplay(getO1Title(),false);
ENDSTYLE
END



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
December 16, 2016, 12:06 PM
Enigma006
I ran the same code for reference line and I still see solid red line. Maybe its the version or something. I am on 7.7.03 and IE 11.

My data is like this. 8 unique values in SERIES_SORTED_VALUE. 10 years and 12 months per each year.
I have a line for each series (8 lines) with year on X-axis and 7 series on Y1 and 1 series on Y2.

SERIES_SORTED_VALUE  YEAR   MONTH   SALE_VALUE
A                    1990   01      100
A                    1990   02      110
...
B                    1990   01      105
B                    1990   02      106
...
F                    1990   01      221
...

This message has been edited. Last edited by: Enigma006,


8.1.05
HTML,PDF,EXL2K, Active, All
December 23, 2016, 08:35 AM
Tamra
Here is the link to WebFOCUS Graphics WebFOCUS 7.7.02

- Click the "+" to expand, there is a PDF at the end of the list of links

- review for examples of the type of graph you are looking for
- Reference Lines - page 73

Happy Holidays.

Thank your for participating in the Focal Point Forum,
Tamra Colangelo
Focal Point Moderator
Information Builders


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
January 03, 2017, 02:49 PM
Enigma006
quote:
Originally posted by MartinY:
YEAR_VALUE will be repeated as many time SERIES_SORTED_VALUE have value.
If you have 3 different values in SERIES_SORTED_VALUE, YEAR_VALUE will be repeated 3 times.

You group the year and month BY the SERIES_SORTED_VALUE so they will be repeated for each break of SERIES_SORTED_VALUES.

Look at your data with a regular report first, you may be then able to see how it result
TABLE FILE GR_DATA
SUM SALE_VALUE
BY HIGHEST SERIES_SORTED_VALUE
ACROSS YEAR_VALUE
ACROSS MONTH_VALUE
END

[/code]


Martin, In WF 8, I am getting dashes without problem.
But I am still looking at YEAR_VALUE repeating many times when SERIES_SORTED_VALUE has value. I looked at data and it is happening so.
I am not sure how to modify the data. My graph looks exactly as needed other than this labels. So, modifying the data may mess up the whole graph.

SERIES_SORTED_VALUE  YEAR   MONTH   SALE_VALUE
A                    1990   01      100
A                    1990   02      110
...
A                    1990   12      123
A                    1991   01      191
...
A                    1991   12      102 


B                    1990   01      107
B                    1990   02      119
...
B                    1990   12      113
B                    1991   01      141
...
B                    1991   12      122 


Sample Data is as mentioned above. Please suggest.


8.1.05
HTML,PDF,EXL2K, Active, All