Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Line break in the x axis label of the graph

163
Views
1
Comments
Raghi
Raghi Rank 1 - Community Starter

Hi, I have created a graph in which x axis contain year and quarter. As part of the standard format, we want X axis label of the report as like below screenshot. (i.e. For quarter 1 year to be appended and there should be a new line between quarter and year) 

image.png

I have tried 2 approaches to add line break in the label of horizontal axis in graphs.

  1.   Added <br> in the column formula of the year. -->Column formula - case when "Period"."Quarter Number"=1 then "Period"."Quarter" || '<br> ' ||  cast("Period"."Year" as varchar(4)) else ' ' || "Period"."Quarter" end . But here I haven't got any changes in the graph.
  2.   By using ‘Evaluate’ function, can execute the function “chr” with input argument as (10) – chr(10) should give a new line and this was used in the expression to build the label.

case when "Period"."Quarter Num"=1 then "Period"."Quarter" ||EVALUATE('chr(%1)' ,'10') ||  cast("Period"."Year" as varchar(4)) else ' ' || "Period"."Quarter" end

With this approach for Graph, for label orientation 90 & 60, seems this working. But for zero orientations, the newline is being replaced by character “~@” 

image.png

Any advice on this would be really appreciated.

Comments

  • Gianni Ceresa
    edited Sep 20, 2023 9:18AM

    Hi,

    What version are you on? I would randomly guess some 12c version, but always better to ask (because in the past the rendering of charts changed at some point).

    For your 2nd approach, do not waste EVALUATE, just use CHAR(10) in the column formula directly. You will still get the same result. The logic generating the SVG chart does strip HTML content (making your approach 1 not working), and also looks like it just replace a \n or \r by that ~@ .

    This could probably be reported as a bug: if the SVG chart doesn't support \r or \n they can remove it, but it's weird to replace it by a ~@ .


    PS: in the future, click on "ask a question" instead of "start a discussion". They have a different behavior in the forum context, but it has been poorly setup and therefore the discussion option is still there. Nothing you can change now, just saying for the future :)

    image.png