Align DataLabels of Solidguage in Highcharts - html

I am trying to create a solidguage highchart, but i am not able to align datalabels as per the visual. My code for the chart is:
function dcadjustmentschart() {
$('#adjustments-chart1').highcharts({
chart: {
type: 'solidgauge',
marginTop: 0,
}
},
title: {
text: null,
},
credits : {
enabled : false
},
exporting: {
enabled: false
},
tooltip: {
borderWidth: 0,
enabled: true,
backgroundColor: 'none',
shadow: false,
style: {
fontSize: '16px'
},
positioner: function (labelWidth, labelHeight) {
return {
x: 200 - labelWidth / 2,
y: 180
};
}
},
pane: {
startAngle: 0,
endAngle: 360,
background: [{ // Track for Move
outerRadius: '100%',
innerRadius: '100%',
borderWidth: 2
}]
},
yAxis: {
min: 0,
max: 100,
lineWidth: 0,
tickPositions: []
},
plotOptions: {
solidgauge: {
borderWidth: '5px',
},
dataLabels: {
borderWidth: "0",
marginTop: "0"
}
},
series: [{
enableMouseTracking: false,
name: 'Forward <br/> By <br/> 45',
borderColor: Highcharts.getOptions().colors[0],
data: [{
color: Highcharts.getOptions().colors[0],
radius: '100%',
innerRadius: '100%',
y: 45,
}],
dataLabels: {
formatter: function () {
return this.series.name
},
y: 25,
x: -50,
styles: {
fontSize: "12px",
borderWidth: "0",
fontWeight: "bold",
width: "50px",
marginleft: "50px"
}
}
}]
});
};
Above is the output.
This is what I need:
I want to align the text "Forward by 45" in the center of the circle
I am using <br/> to break the texts to the second line, how to get rid of that?
I want to change the background color of the circle

I think that you have small mistake in your code. Instead of dataLabels.styles you should use dataLabels.style. Here you can see information about this parameter in Highcharts API:
http://api.highcharts.com/highcharts#plotOptions.solidgauge.dataLabels.style
You can use 'text-anchor' property width dataLabels.align and dataLabels.verticalAlign to position your text in the center of you pane:
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor
http://api.highcharts.com/highcharts#plotOptions.solidgauge.dataLabels.align
http://api.highcharts.com/highcharts#plotOptions.solidgauge.dataLabels.verticalAlign
You can add backgroundColor inside your background array:
http://api.highcharts.com/highcharts#pane.background
function dcadjustmentschart() {
$('#container').highcharts({
chart: {
type: 'solidgauge',
marginTop: 0,
},
title: {
text: null,
},
credits: {
enabled: false
},
exporting: {
enabled: false
},
pane: {
startAngle: 0,
endAngle: 360,
background: [{
backgroundColor: '#bada55',
borderWidth: 0,
outerRadius: '100%'
}, {
outerRadius: '100%',
innerRadius: '100%',
borderWidth: 2,
borderColor: 'black'
}],
},
yAxis: {
min: 0,
max: 100,
lineWidth: 0,
tickPositions: []
},
plotOptions: {
solidgauge: {
borderWidth: '5px',
dataLabels: {
padding: 0,
x: 25,
align: 'center',
verticalAlign: 'middle',
}
},
},
series: [{
enableMouseTracking: false,
name: 'Forward By 45',
borderColor: Highcharts.getOptions().colors[0],
data: [{
color: Highcharts.getOptions().colors[0],
radius: '100%',
innerRadius: '100%',
y: 45,
}],
dataLabels: {
overflow: "none",
crop: false,
borderWidth: 0,
formatter: function() {
return this.series.name
},
y: 0,
style: {
fontSize: "12px",
fontWeight: "bold",
width: "50px",
textAnchor: 'middle',
}
}
}]
});
};
dcadjustmentschart()
Here you can see an example how it can work:
http://jsfiddle.net/cune5qs5/25/
Kind regards.

Related

Have a horizontal scrollbar on the top and bottom of a v-data-table (Vuetify)

what happens is that I have a v-data-table, by default I have a horizontal scrollbar at the bottom, but I want this scrollbar both below and above the table.
I tried to research in several forums and articles but there is no information about this when it comes to a v-data-table.
Here a example of what I want to do
Here is the code:
<template>
<v-container>
<v-data-table
:headers="headers"
:items="desserts"
:items-per-page="5"
class="elevation-1"
></v-data-table>
</v-container>
</template>
<script>
export default {
name: 'HelloWorld',
data () {
return {
headers: [
{
text: 'Dessert (100g serving)',
align: 'start',
sortable: false,
value: 'name',
width: 300
},
{ text: 'Calories', value: 'calories', width: 300},
{ text: 'Fat (g)', value: 'fat', width: 300 },
{ text: 'Carbs (g)', value: 'carbs', width: 300 },
{ text: 'Protein (g)', value: 'protein', width: 300 },
{ text: 'Iron (%)', value: 'iron', width: 300 },
],
desserts: [
{
name: 'Frozen Yogurt',
calories: 159,
fat: 6.0,
carbs: 24,
protein: 4.0,
iron: '1%',
},
{
name: 'Ice cream sandwich',
calories: 237,
fat: 9.0,
carbs: 37,
protein: 4.3,
iron: '1%',
},
{
name: 'Eclair',
calories: 262,
fat: 16.0,
carbs: 23,
protein: 6.0,
iron: '7%',
},
{
name: 'Cupcake',
calories: 305,
fat: 3.7,
carbs: 67,
protein: 4.3,
iron: '8%',
},
{
name: 'Gingerbread',
calories: 356,
fat: 16.0,
carbs: 49,
protein: 3.9,
iron: '16%',
},
{
name: 'Jelly bean',
calories: 375,
fat: 0.0,
carbs: 94,
protein: 0.0,
iron: '0%',
},
{
name: 'Lollipop',
calories: 392,
fat: 0.2,
carbs: 98,
protein: 0,
iron: '2%',
},
{
name: 'Honeycomb',
calories: 408,
fat: 3.2,
carbs: 87,
protein: 6.5,
iron: '45%',
},
{
name: 'Donut',
calories: 452,
fat: 25.0,
carbs: 51,
protein: 4.9,
iron: '22%',
},
{
name: 'KitKat',
calories: 518,
fat: 26.0,
carbs: 65,
protein: 7,
iron: '6%',
},
],
}
},
}
</script>
Technically, a div cannot have more than one scrollbar on the same direction.
What we can do is create a second element, with dummy content of the same size as the content of the element we want to scroll, and then link the scrolling functions between the two elements. Simply put, when we scroll one, we also scroll the other.
Here's a vanilla implementation, demonstrating the principle:
window.addEventListener("DOMContentLoaded", () => {
const updateScrollers = () => {
dummy.style.width = _b.scrollWidth + "px";
};
updateScrollers();
window.addEventListener("resize", updateScrollers);
const linkScroller = (a, b) => {
a.addEventListener("scroll", (e) => {
b.scrollLeft = e.target.scrollLeft;
});
};
[
[_a, _b],
[_b, _a],
].forEach((args) => linkScroller(...args));
});
#_a,
#_b {
overflow-x: auto;
}
.content {
height: 100px;
width: 200vw;
}
#_a > div {
height: 1px;
}
#_b .content {
background: repeating-linear-gradient(
45deg,
#fff,
#fff 50px,
#f5f5f5 50px,
#f5f5f5 80px
);
}
<div id="_a">
<div id="dummy"></div>
</div>
<div id="_b">
<div class="content"></div>
</div>
If you need help implementing it in your project, you'll have to create a runnable minimal, reproducible example first.
With Vue, all we need to do is update the model value (onScroll) and let Vue handle the DOM updates (e.g: :scroll-left.camel="scrollLeft").
const { createApp, onMounted, onBeforeUnmount, reactive, toRefs } = Vue;
createApp({
setup: () => {
const state = reactive({
scrolled: null,
dummy: null,
scrollLeft: 0,
onScroll: (e) => (state.scrollLeft = e.target.scrollLeft),
});
const updateScroller = () => {
state.dummy.style.width = state.scrolled.scrollWidth + "px";
};
onMounted(() => {
window.addEventListener("resize", updateScroller);
updateScroller();
});
onBeforeUnmount(() => {
window.removeEventListener("resize", updateScroller);
});
return toRefs(state);
},
}).mount("#app");
.scroller,
.scrolled {
overflow-x: auto;
}
.scroller > div {
height: 1px;
}
.scrolled span {
height: 100px;
display: inline-block;
width: 200vw;
background: repeating-linear-gradient(
45deg,
#fff,
#fff 50px,
#f5f5f5 50px,
#f5f5f5 80px
);
}
<script src="https://unpkg.com/vue/dist/vue.global.prod.js"></script>
<div id="app">
<div
class="scroller"
#scroll.passive="onScroll"
:scroll-left.camel="scrollLeft"
>
<div ref="dummy"></div>
</div>
<div
ref="scrolled"
class="scrolled"
#scroll.passive="onScroll"
:scroll-left.camel="scrollLeft"
>
<span />
</div>
</div>

How can i change the height of a grid in Primefaces?

How can i change the height of a grid of a Piechart in Primefaces?
function skinPie() {
this.cfg.shadow = false;
this.cfg.title = '';
this.cfg.grid = {
background: '#ffffff',
borderColor: '#ffffff',
gridLineColor: '#F5F5F5',
shadow: false,
};
It's not clear what you meant about the height of grid of a pieChart, but here are some configurations for sizing it:
this.cfg.gridPadding = {top: 0, bottom: 10, left: 0, right: 0};
this.cfg.seriesDefaults = {shadow: true,
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
fill: false,
sliceMargin: 4,
diameter: 250,
gridLineWidth: 1.0,
showDataLabels: true
}
}
Please, let me know if that was what you wanted or, in case if it's not, explain me about what you need.

Is it possible to set the background of a new tab page to a HTML file?

I was wondering if it was possible to set HTML code as a background for chrome.
Here is a edited example: Example (Replace green with HTML output)
I was going to insert this HTML code into the background:
particlesJS('particles-js',
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#ffffff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 3,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#ffffff",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 3,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "bounce",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "grab"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 100,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
});
window.onscroll = function(){
var navbar = document.querySelector('.navbar')
if (window.pageYOffset > 49){
if (navbar.classList.contains('transparent')){
navbar.classList.remove('transparent')
navbar.classList.add('opaque')
}
}else{
if (navbar.classList.contains('opaque')){
navbar.classList.remove('opaque')
navbar.classList.add('transparent')
}
}
};
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>JS particles example</title>
<style>
#particles-js {
width: 100%;
height: 100%;
background-color: #49A8EB;
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;
z-index: -1;
position: fixed;
left: 0;
top: 0;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body>
<div id="particles-js"></div>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/svginjector/1.1.3/svg-injector.min.js"></script> -->
<script src="js/app.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/particles.js/2.0.0/particles.min.js'></script>
<script src="js/index.js"></script>
</body>
</html>
Is there any way possible to do this? If so, I would love to know!
P.S. I've already tried looking this up and trying things out.

Apply backdrop filter to svg path element

I have a page with some background image.
In body tag I have a svg element with only one inner path element.
How to add backdrop-filter to path element so it could blur background in non-rectangular shape?
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 80,
ease: Strong.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 80,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
delay: 0.15,
ease: Back.easeOut,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>
Without doing too many changes to your code, you can achieve that by increasing your power and/or decreasing your offsetTop in the open function.
TweenMax.to(settings, 0.35, {overwrite: true, offsetTop: 80, ease: Strong.easeOut, onUpdate: render })
TweenMax.to(settings, 1, {power: 120, ease: Elastic.easeOut, onUpdate: render })
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 80,
ease: Strong.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 150,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
delay: 0.15,
ease: Back.easeOut,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>
Quadratic Bézier curve
Another solution is to add a curved path (called quadratic Bézier curve) to your rectangle. The curve is built like this:
M{startWidth}, {startHeight} q {curvePeak}, {curveHeight}, {endWidth}, {endHeight}
startWidth - x-axis positioning of P0: x coordinate where the curve starts
startHeight - y-axis positioning of P0: y coordinate where the curve starts
curvePeak - x-axis positioning of P1: where the curve reach it's peak
curveHeight - y-axis positioning of P1: height of the curve
endWidth - x-axis positioning of P2: dimension of the curve
endHeight - y-axis positioning of P2: inclination of the curve
See also: Quadratic Bézier Curve: Calculate Points or click here for an interactive example of the quadratic Bézier curve.
Negative
This solution has some problems when using two different animations and duration, like in your case.
Strong.easeOut : 0.35s
Elastic.easeOut : 1.00s
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z q 600, 100, 1200, 0";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 80,
ease: Strong.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 80,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
delay: 0.15,
ease: Back.easeOut,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>
Positive
On the contrary it works great when using the same animation and duration.
Both with Elastic.easeOut : 1.00s
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z q 600, 100, 1200, 0";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 1, {
overwrite: true,
offsetTop: 80,
ease: Elastic.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 80,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
ease: Back.easeIn,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>

Set delay for fading in concentric circles with Kinetic

I am a newby so, I wonder if someone can point me in the right direction. I need to draw 3 concentric circles with opacity that need to appear on the screen one after the other. At present, although very faintly, I can see them all. How can I make them appear one after the other?
This is my current code:
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
background-color: #CCCCCC;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<div id="container"></div>
<script src="kinetic-v4.3.0-beta2.js"></script>
<script>
var fadeIn = function(shape) {
var o = shape.getOpacity();
o = o + 0.05 >=0.5 ? 0.5 : o + 0.05;
shape.setOpacity(o);
shape.getLayer().draw();
if(o !== 0.4) {
setTimeout(function() {
fadeIn(shape).delay(3000*3);
}, 720);
}
};
var stage = new Kinetic.Stage({
container: 'container',
width: 578,
height: 200
});
var layer = new Kinetic.Layer();
var circle = new Kinetic.Circle({
x: stage.getWidth() / 2,
y: stage.getHeight() / 2,
radius: 70,
fill: '#CCCCCC',
stroke: 'yellow',
strokeWidth: 8,
opacity: 0.1
});
setTimeout(function() {
fadeIn(circle).delay(3000*3);
}, 1720);
layer.add(circle);
var circle2 = new Kinetic.Circle({
x: stage.getWidth() / 2.1,
y: stage.getHeight() / 2.1,
radius: 70,
fill: '#CCCCCC',
stroke: 'yellow',
strokeWidth: 8,
opacity: 0.1
});
setTimeout(function() {
fadeIn(circle2).delay(3000*3);
}, 5600);
// add the shape to the layer
layer.add(circle2);
var circle3 = new Kinetic.Circle({
x: stage.getWidth() / 2.2,
y: stage.getHeight() / 2.2,
radius: 70,
fill: '#CCCCCC',
stroke: 'yellow',
strokeWidth: 8,
opacity: 0.1
});
setTimeout(function() {
fadeIn(circle3).delay(3000*3);
}, 12000);
// add the shape to the layer
layer.add(circle3);
// add the layer to the stage
stage.add(layer);
</script>
</body>
</html>
You can hide the circles when you initialize them i.e. circle.hide() before you add them to layer, and then show them when your timeout-callback is called, for instance for circle2, use it like this.
setTimeout(function() {
circle2.show();
fadeIn(circle2).delay(3000*3);
}, 5600);