How to have fixed size of bars in graph?
Example: When the graph has 20 bars, the size (width) of each bar is different from when the graph has 3 bars. The bar size (width) changing according to the number of bars in the graph.
Is there any way to have the bar's size same irrespective of the number of bars in the graph?
ThanksThis message has been edited. Last edited by: FP Mod Chuck,
i think so ,it's not possible.
WebFOCUS 7.1.4, Win XP SP2,
I already checked with "setRiserWidth()". It’s not making any change. It's keep changing according to the number of bars.
It looks as though setRiserWidth() relates the percentage of the available space for the riser. So, if you really want to achieve this, you would have to resort to some calculation outside of your graph and maybe set the HAXIS and VAXIS according to the number of expected risers.
But doing that, the graph frame size won't be same across graphs. A report can have many graphs and the maximum number of bars in each graph can be up to 20. So dynamically i need to find the number of bars and for the remaining (20 - number of bars), i need to create dummy bars.
Yet to try....
Use the COLUMNS syntax with blank values to do that. Something like -
-DEFAULT &Max_Cols = 20 -SET &ECHO=ALL; TABLE FILE CAR PRINT CAR WHERE COUNTRY EQ 'ITALY' OR 'FRANCE' OR 'ENGLAND' ON TABLE SAVE END -RUN -SET &Count = &Max_Cols - &LINES; -SET &Columns = 'COLUMNS '; -READ SAVE, &Car -REPEAT :Loop1 WHILE &IORETURN EQ 0; -SET &Columns = IF &Columns NE 'COLUMNS ' THEN &Columns | ' AND ' ELSE &Columns ; -SET &Columns = &Columns | '''&Car.EVAL''' ; -READ SAVE, &Car -:Loop1 -REPEAT :Loop2 &Count TIMES; -SET &Columns = &Columns | ' AND ' | ''' ''' ; -:Loop2 GRAPH FILE CAR SUM RCOST ACROSS CAR &Columns ON GRAPH SET GRAPHSTYLE * ENDSTYLE END
This will always give the same number of risers as the value in &Max_Cols.
Your code is working fine. But when I apply the same code in my code, I am getting the following error message. Please have a look.
GRAPH FILE TEST
SUM TOT_AMT AS 'Amount'
ACROSS NAME AS '' COLUMNS 'Antony' AND 'Sachin' AND 'Shankar' AND 'Nitesh' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' ' AND ' '
ON GRAPH SET GRAPHSTYLE *
0 NUMBER OF RECORDS IN GRAPH= 4 PLOT POINTS= 0
NO DATA TO GRAPH
Please let me know why I get this error.
Anyone ever figure this out?
Don't know which version you are using but look at page 149 (also available in other document version at different page): Adding Color-By and Size-By Fields. Maybe the solution is there.
Creating HTML5 Charts
WF versions : Prod 184.108.40.206M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
Try searching for "riser width" in the documentation.
Remember that for non HTML charting (JSCHART) you will need to concentrate on the Perspective for Java settings (normally start setO1Axis etc.)
Thanks for the recommendations, but the "bucket" command just broke everything, and apparently doesn't work with VBAR. The jschart settings when copied whole-cloth stop the graph from printing without providing an error message.
This seems like a painfully simple, painfully obvious option that should just have a really really basic setting like "WIDTH=10" but apparently that's not the case.
My GRAPH TABLE command produces a separate graph for each month. Completed months are similar enough that it doesn't matter, the newest month, especially on the 1st day, look absurd. I'd just like them to show one bar the same width as the other graphs and then blank space to the right of that.This message has been edited. Last edited by: John_Edwards,
So your charts are for all days of a month? Why not just force the day numbers that you need? Any months that do not have 31 days, you could just add a dummy enforced column as per my reply to Antony.
|Powered by Social Strata|