Hey I am trying to build the following picture in canvas using the library:EaselJS.
My Picture components are:
- two circles - yellow and red and a light green background
- several small black points
- a coordinate system from 0 to 1 with all the necessary labels which appear in the picture.
I have succeeded in first goal: creating 2 circles and position them in the top right corner of my canvas. The second goal and especially the third goal(building coordinate system) looks to me like impossible task. I have search the API of EaselJS for any clue for how creating such structure and didn't got any info which can help me in achieving my third goal. I am attaching the code of the canvas which has been build so far:
function init() {
var stage = new createjs.Stage("demoCanvas");
var circle1 = new createjs.Shape();
var circle2 = new createjs.Shape();
circle2.graphics.beginFill("yellow").drawCircle(0, 0, 300);
circle2.x = 500;
circle2.y = 0;
stage.addChild(circle2);
circle1.graphics.beginFill("red").drawCircle(0, 0, 150);
circle1.x = 500;
circle1.y = 0;
stage.addChild(circle1);
stage.update();
}
#demoCanvas{
background-color: #32CD32;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
<body onload="init();">
<canvas id="demoCanvas" width="500" height="500"></canvas>
</body>