<div id="container"></div>
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
var base = document.createElement('base');
base.href = './../../';
document.head.appendChild(base);
var stage = acgraph.create('container');
// Use relative path to url.
acgraph.useAbsoluteReferences(false);
var gradient = [
{
offset: 0,
color: '#F44336'
},
offset: 0.5,
color: '#4CAF50'
offset: 1,
color: '#2196F3'
];
var rectangle = stage.rect(10, 10, 100, 100);
rectangle.fill(gradient);