How to break a chart title into specific lines

Options
CodeRookie
edited February 11, 2022 in Analytics #1

Good morning, all!
I have a chart design with a lengthy title, that I would like to 'break' at certain points (see pic). I'm guessing this will need the use of 'function beforeDrawSeriesTitle( series, label, icsc )' and a bit of other code to make this possible. How would I go about making this happen? The output format is HTML 5, and I'm using designer version 4.4.0.

Thanks in advance for the help, and have a great day!!!

Scott

Comments

  • I have used the onRender and using the /n will create a new line in version 3.7.1 in eclipse designer
    var myTitle = chart.getTitle().getLabel().getCaption().getValue();
    var title = icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("title");
    function beforeGeneration(chart,isc)
    chart.getTitle().getLabel().getCaption().setValue(BirtDateTime.year(BirtDateTime.today()) +"/n" + title +"/n" + myTitle)

  • Thanks for the help! I'll give it a shot.