Stacked Bars

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
Microsolutions
Newbie
Newbie
Posts: 10
Joined: Tue May 10, 2016 12:00 am

Stacked Bars

Post by Microsolutions » Tue May 10, 2016 3:48 pm

Hello,

please check the following sample code:

Code: Select all

<!DOCTYPE html>
<head>
<title>Stacked Bars</title>
<script src="https://www.steema.com/files/public/teechart/html5/latest/src/teechart.js" type="text/javascript"></script>
<script type="text/javascript">
function draw() {
  var Chart1=new Tee.Chart("Canvas1");
  Chart1.title.text="Stacked Bars";
  var Series1=Chart1.addSeries(new Tee.Area());
  Series1.title="Series1";
  Series1.data.values=[192,72,24,12];
  Series1.data.x=[1,2,3,4];
  Series1.stacked="no";
  var Series2=Chart1.addSeries(new Tee.Bar());
  Series2.title="Series2";
  Series2.data.values=[60,72,24,5];
  Series2.data.x=[1,2,3,4];
  Series2.stacked="yes";
  var Series3=Chart1.addSeries(new Tee.Bar());
  Series3.title="Series3";
  Series3.data.values=[192,119,48,24];
  Series3.data.x=[1,2,3,4];
  Series3.stacked="yes";
  Chart1.draw();
}
</script>
</HEAD>
<BODY onload="draw()">
<canvas id="Canvas1" width="800" height="600">
This browser does not seem to support HTML5 Canvas.
</canvas>
</BODY>
</HTML>
Comments:
- the bars are using the Series1 for stacking even if it is not stacked,
- changing the create order of the series (Series2, Series3, Series1) solves the problem, but the Series1 should be in the "background".

How can I avoid this behaviour?

Thanks in advance,
MS

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

Re: Stacked Bars

Post by Yeray » Thu May 12, 2016 2:47 pm

Hello,

I could reproduce the problem so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1538

I've fixed it; that's why it's already closed.

Thanks for reporting it.
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

Microsolutions
Newbie
Newbie
Posts: 10
Joined: Tue May 10, 2016 12:00 am

Re: Stacked Bars

Post by Microsolutions » Thu May 12, 2016 2:55 pm

Hello,

many thanks for the quick bugfix!

Best regards,
MS

Post Reply