Page 1 of 1
Multi Row Chart Title
Posted: Tue Oct 01, 2013 10:55 pm
by 17766947
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.
Re: Multi Row Chart Title
Posted: Wed Oct 02, 2013 2:45 pm
by yeray
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 (38.28 KiB) Viewed 7841 times