Using the example from the teecharts evaluation copy we tried to plot multiple charts on the same canvas but it is not working. All it does is that it simply plots the graph that is drawn at the end(inside if (three.isEnabled()) {
part), and ignores the graphs drawn before it.
var three, Chart1, Chart2, surface;
function draw() {
// Create 3D WebGL context:
three = new Tee.Three("canvas1");
// Create Chart:
Chart1 = new Tee.Chart(three);
Chart2 = new Tee.Chart(three);
Chart1.walls.visible=false;
// Create Surface:
surface = new Tee.Surface();
// Add Surface series to Chart:
Chart1.addSeries(surface);
Chart2.addSeries(new Tee.Line()).addRandom(1000);
changeSurface("s3");
// Cosmetics:
Chart1.title.text="TeeChart Surface 3D";
Chart1.walls.back.size=0.2;
Chart1.walls.back.format.transparency=0.2;
// Valid webGL ?
if (three.isEnabled()) {
Chart1.draw();
Chart2.draw();
animate();
}
else
Detector.addGetWebGLMessage(); // Show message (WebGL not available)
// Loop
function animate() {
three.update();
requestAnimationFrame( animate );
}
}
My question is: Is it possible to plot multiple graphs inside the same canvas?( By multiple I don't mean they would share axes, I mean two completely separate chart objects inside the canvas)