Multi Row Chart Title

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
john spooner
Newbie
Newbie
Posts: 1
Joined: Mon Sep 09, 2013 12:00 am

Multi Row Chart Title

Post by john spooner » Tue Oct 01, 2013 10:55 pm

How can I have a chart title with more than one row. I tried using a \n character.
That is I tried something like Chart.title.text='arow\nanotherrow'.
But the result was my two desired rows were written on top of each other. I tried a \r but that was ignored.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Multi Row Chart Title

Post by Yeray » Wed Oct 02, 2013 2:45 pm

Hi John,

This seems to work fine for me here:

Code: Select all

<!DOCTYPE html>
<html>
<head>
<title>Testing</title>

<!--[if lt IE 9]>
    <script src="../src/excanvas/excanvas_text.js"></script>
    <script src="../src/excanvas/canvas.text.js"></script>
<![endif]-->

<script src="http://www.steema.com/files/public/teechart/html5/v2012.12.14.1.4/src/teechart.js" type="text/javascript"></script>

<script type="text/javascript">

var Chart1;

function draw() {

  Chart1 = new Tee.Chart("canvas1");

  Chart1.title.text='a row\nanother row';

  Chart1.addSeries(new Tee.Line).addRandom(10);
  
  Chart1.draw();
}
</script>
</head>
<body onload="draw()">
<br><canvas id="canvas1" width="600" height="400">
This browser does not seem to support HTML5 Canvas.
</canvas>
</body>
</html>
2013-10-02_1645.png
2013-10-02_1645.png (38.28 KiB) Viewed 7843 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply