Lines Matching refs:ctx

1671 function roundedRect(ctx,x,y,width,height,radius){  argument
1672 ctx.beginPath();
1673 ctx.moveTo(x,y+radius);
1674 ctx.lineTo(x,y+height-radius);
1675 ctx.quadraticCurveTo(x,y+height,x+radius,y+height);
1676 ctx.lineTo(x+width-radius,y+height);
1677 ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius);
1678 ctx.lineTo(x+width,y+radius);
1679 ctx.quadraticCurveTo(x+width,y,x+width-radius,y);
1680 ctx.lineTo(x+radius,y);
1681 ctx.quadraticCurveTo(x,y,x,y+radius);
1682 ctx.closePath();
1684 function drawString(ctx, text, fc, tx, ty) { argument
1686 ctx.beginPath();
1689ctx.drawImage(font, signs[c].sx, signs[c].sy, signs[c].sw, signs[c].sh, tx+xp, ty, signs[c].sw*fc,…
1692 ctx.closePath();
1694 function strokeString(ctx, txt, col, fh, tx, ty) { argument
1697 ctx.lineCap = "round"; ctx.lineJoin = "round"
1698 ctx.lineWidth = lw; ctx.strokeStyle = col;
1700 strokeSymbol(ctx, txt[i], ls, tx+xp, ty, fw, fh);
1704 function strokeSymbol(ctx, symbol, fc, cx, cy, cw, ch) { argument
1705 ctx.beginPath();
1708 ctx.moveTo(cx+fc,cy+(ch*0.333333));
1709 ctx.arc(cx+(cw/2),cy+(cw/2),(cw/2)-fc,deg2rad(180),0, false);
1710 ctx.arc(cx+(cw/2),(cy+ch)-(cw/2),(cw/2)-fc,0,deg2rad(180), false);
1711 ctx.closePath();
1714 ctx.moveTo(cx+(cw*0.1)+fc,cy+ch-fc);
1715 ctx.lineTo(cx+cw-fc,cy+ch-fc);
1716 ctx.moveTo(cx+(cw*0.666666),cy+ch-fc);
1717 ctx.lineTo(cx+(cw*0.666666),cy+fc);
1718 ctx.lineTo(cx+(cw*0.25),cy+(ch*0.25));
1721 ctx.moveTo(cx+cw-fc,cy+(ch*0.8));
1722 ctx.lineTo(cx+cw-fc,cy+ch-fc);
1723 ctx.lineTo(cx+fc,cy+ch-fc);
1724 ctx.arc(cx+(cw/2),cy+(cw*0.425),(cw*0.425)-fc,deg2rad(45),deg2rad(-180), true);
1727 ctx.moveTo(cx+(cw*0.1)+fc,cy+fc);
1728 ctx.lineTo(cx+(cw*0.9)-fc,cy+fc);
1729 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-90),deg2rad(180), false);
1732 ctx.moveTo(cx+(cw*0.75),cy+ch-fc);
1733 ctx.lineTo(cx+(cw*0.75),cy+fc);
1734 ctx.moveTo(cx+cw-fc,cy+(ch*0.666666));
1735 ctx.lineTo(cx+fc,cy+(ch*0.666666));
1736 ctx.lineTo(cx+(cw*0.75),cy+fc);
1737 ctx.moveTo(cx+cw-fc,cy+ch-fc);
1738 ctx.lineTo(cx+(cw*0.5),cy+ch-fc);
1741 ctx.moveTo(cx+(cw*0.9)-fc,cy+fc);
1742 ctx.lineTo(cx+(cw*0.1)+fc,cy+fc);
1743 ctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.333333));
1744 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-80),deg2rad(180), false);
1747 ctx.moveTo(cx+fc,cy+ch-(cw*0.5)-fc);
1748 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-180),deg2rad(180), false);
1749 ctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.9)-fc,cy+fc);
1750 ctx.moveTo(cx+(cw*0.9)-fc,cy+fc);
1753 ctx.moveTo(cx+(cw*0.5),cy+ch-fc);
1754 ctx.lineTo(cx+cw-fc,cy+fc);
1755 ctx.lineTo(cx+(cw*0.1)+fc,cy+fc);
1756 ctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.25)-fc);
1759 ctx.moveTo(cx+(cw*0.92)-fc,cy+(cw*0.59));
1760 ctx.arc(cx+(cw/2),cy+(cw*0.45),(cw*0.45)-fc,deg2rad(25),deg2rad(-205), true);
1761 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-135),deg2rad(-45), true);
1762 ctx.closePath();
1763 ctx.moveTo(cx+(cw*0.79),cy+(ch*0.47));
1764 ctx.lineTo(cx+(cw*0.21),cy+(ch*0.47));
1767 ctx.moveTo(cx+cw-fc,cy+(cw*0.5));
1768 ctx.arc(cx+(cw/2),cy+(cw*0.5),(cw*0.5)-fc,deg2rad(0),deg2rad(360), false);
1769 ctx.bezierCurveTo(cx+cw-fc,cy+ch-fc,cx+cw-fc,cy+ch-fc,cx+(cw*0.1)+fc,cy+ch-fc);
1772 ctx.moveTo(cx+fc,cy+(ch*0.75));
1773 ctx.lineTo(cx+cw-fc,cy+(ch*0.25));
1774 ctx.moveTo(cx+(cw*0.505),cy+(cw*0.3));
1775 ctx.arc(cx+(cw*0.3),cy+(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);
1776 ctx.moveTo(cx+(cw*0.905),cy+ch-(cw*0.3));
1777 ctx.arc(cx+(cw*0.7),cy+ch-(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);
1780 ctx.moveTo(cx+(cw*0.25),cy+ch-fc-fc);
1781 ctx.arc(cx+(cw*0.25),cy+ch-fc-fc,fc,deg2rad(0),deg2rad(360), false);
1782 ctx.closePath();
1787 ctx.stroke();
1789 function drawBar(ctx,x,y,width,height,color,value,textdiv){ argument
1796 ctx.save();
1797 S2L = ctx.createRadialGradient(x+rw+rh,y+height-rw+yy+rh,0,x+rw,y+height-rw+yy,rw);
1802 ctx.fillStyle = S2L;
1803 ctx.scale(1,0.5);
1804 ctx.translate(xx,y+height+yy);
1806 ctx.fillRect(x,y+yy+height-width,width,width);
1808 ctx.arc(x+rw,y+yy+height-width,width,0,deg2rad(360), false);
1809 ctx.fill();
1811 ctx.restore();
1813 ctx.fillStyle = 'rgba(0,0,0,0.2)';
1814 ctx.fillRect(x+yo,y+rh+yo+yo,width,dh);
1818 ctx.beginPath();
1819 ctx.moveTo(x,y+rh);
1820 ctx.lineTo(x,y+rh+dh);
1821 ctx.bezierCurveTo(x,y+height,x+width,y+height,x+width,y+rh+dh)
1822 ctx.lineTo(x+width,y+rh);
1823 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1824 ctx.closePath();
1825 ctx.fillStyle = color;
1826 ctx.fill();
1827 S2L = ctx.createLinearGradient(x,y+(height/2),x+width,y+(height/2));
1834 ctx.beginPath();
1835 ctx.moveTo(x,y+rh);
1836 ctx.lineTo(x,y+rh+dh);
1837 ctx.bezierCurveTo(x,y+height,x+width,y+height,x+width,y+rh+dh)
1838 ctx.lineTo(x+width,y+rh);
1839 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1840 ctx.closePath();
1841 ctx.fillStyle = S2L;
1842 ctx.fill();
1843 ctx.beginPath();
1844 ctx.moveTo(x+width,y+rh);
1845 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1846 ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
1847 ctx.closePath();
1848 ctx.fillStyle = color;
1849 ctx.fill();
1850 S2L = ctx.createLinearGradient(x+rw-(width*0.15),y-2,x+rw+(width*0.15),y+(2.1*rh));
1855 ctx.beginPath();
1856 ctx.moveTo(x+width,y+rh);
1857 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1858 ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
1859 ctx.closePath();
1860 ctx.fillStyle = S2L;
1861 ctx.fill();
1862 S2L = ctx.createLinearGradient(x+rw-(width*0.15),y-2,x+rw+(width*0.15),y+(2.1*rh));
1867 ctx.beginPath();
1868 ctx.moveTo(x+width,y+rh);
1869 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1870 ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
1871 ctx.closePath();
1872 ctx.strokeStyle = S2L;
1873 ctx.stroke();
1875 ctx.fillStyle = color;
1876 ctx.fillRect(x,y+rh+yo,width,dh);
1878 ctx.lineCap = "butt";
1879 ctx.lineWidth = 1;
1880 ctx.fillStyle = 'rgba(255,255,255,0.5)';
1896 roundedRect(ctx,x+(width/2)-(bw/2),y,bw,bh,bh/4);
1897 ctx.fill();
1899 strokeString(ctx, value + "%","rgba(48,48,48,1)", th, x+(width/2)-(w/2), y+((bh-th)/2));
1901 drawString(ctx, value + "%", tf, x+(width/2)-(w/2), y+((bh-th)/2.2));
1905 roundedRect(ctx,x,y,bw,bh,bh/4);
1906 ctx.fill();
1920 function drawLine(ctx,x,y,width,height,dist,array,factor,color,fill){ argument
1923 ctx.lineJoin = "miter";
1924 ctx.beginPath();
1925 ctx.moveTo(x,y+height);
1927 ctx.lineTo(x+(i*dist),y+height-(array[i]*factor));
1929 ctx.lineTo(x+width,y+height);
1930 ctx.lineTo(x,y+height);
1931 ctx.closePath();
1932 ctx.fillStyle = style;
1933 ctx.fill();
1935 ctx.lineJoin = "round";
1936 ctx.beginPath();
1937 ctx.moveTo(x,y+height-(array[0]*factor));
1939 ctx.lineTo(x+(i*dist),y+height-(array[i]*factor));
1941 ctx.strokeStyle = color;
1942 ctx.stroke();
2036 var ctx = canvas.getContext('2d');
2038 ctx.fillStyle = canvas_bgcolor;
2039 ctx.fillRect(0,0,cw,ch);
2041 ctx.clearRect(0,0,cw,ch);
2045 ctx.beginPath();
2046 var B2B = ctx.createRadialGradient(cx+(cr*0.1),cy+(cr*0.1),cr,cx+(cr*0.1),cy+(cr*0.1),sr*0.9);
2049 ctx.arc(cx+(cr*0.1),cy+(cr*0.1),cr,0,deg2rad(360), false);
2050 ctx.closePath();
2051 ctx.fillStyle = B2B;
2052 ctx.fill();
2054 var B2B = ctx.createRadialGradient(cx+(cr*0.1),cy+(cr*0.1),0,cx+(cr*0.1),cy+(cr*0.1),cr);
2058 ctx.fillStyle = B2B;
2059 ctx.fillRect(0,0,cw,ch);
2066 ctx.beginPath();
2067 ctx.moveTo(cx,cy);
2068 ctx.arc(cx,cy,cr,sdeg,edeg, false);
2069 ctx.lineTo(cx,cy);
2070 ctx.closePath();
2071 ctx.fillStyle = colorSlice[(idx++)];
2072 ctx.fill();
2075 ctx.beginPath();
2076 var W2T = ctx.createLinearGradient(cp*2,cp*2,cx,cy);
2079 ctx.moveTo(cx,cy);
2080 ctx.arc(cx,cy,sr,deg2rad(135),deg2rad(315), false);
2081 ctx.closePath();
2082 ctx.fillStyle = W2T;
2083 ctx.fill();
2084 ctx.beginPath();
2085 var T2B = ctx.createLinearGradient(cx,cy,cw-(cp*2),ch-(cp*2));
2088 ctx.moveTo(cx,cy);
2089 ctx.arc(cx,cy,sr,deg2rad(-45),deg2rad(135), false);
2090 ctx.closePath();
2091 ctx.fillStyle = T2B;
2092 ctx.fill();
2093 ctx.beginPath();
2094 var B2T = ctx.createLinearGradient(cx,cy,cw-(cp*1.9),ch-(cp*1.9));
2097 ctx.lineWidth = cr*0.07;
2098 ctx.lineCap = "round";
2099 ctx.moveTo(cx,cy);
2100 ctx.arc(cx,cy,cr*0.965,deg2rad(-45),deg2rad(135), false);
2101 ctx.closePath();
2102 ctx.strokeStyle = B2T;
2103 ctx.stroke();
2104 ctx.beginPath();
2105 var T2W = ctx.createLinearGradient(cx,cy,(cp*1.9),(cp*1.9));
2108 ctx.lineWidth = cr*0.07;
2109 ctx.lineCap = "round";
2110 ctx.moveTo(cx,cy);
2111 ctx.arc(cx,cy,cr*0.965,deg2rad(135),deg2rad(315), false);
2112 ctx.closePath();
2113 ctx.strokeStyle = T2W;
2114 ctx.stroke();
2116 ctx.lineCap = "butt";
2117 ctx.lineWidth = 1;
2118 ctx.fillStyle = 'rgba(255,255,255,0.5)';
2159 roundedRect(ctx,(tx-(bw/2)),ty-(bh/2),bw,bh,bh/4);
2160 ctx.fill();
2162 drawString(ctx, per + "%", tf, tx-(w/2), ty-(th/1.8));
2164 strokeString(ctx, per + "%","rgba(48,48,48,1)", th, tx-(w/2), ty-(th/2));
2167 roundedRect(ctx,(tx-(bw/2)),ty-(bh/2),bw,bh,bh/4);
2168 ctx.fill();
2196 var ctx = canvas.getContext('2d');
2198 ctx.fillStyle = canvas_bgcolor;
2199 ctx.fillRect(0,0,canvas_width,canvas_height);
2201 ctx.clearRect(0,0,canvas_width,canvas_height);
2223 drawBar(ctx,pw+(t*(bw*1.1)),ph+ih-bh,bw,bh,colorSlice[(idx++)],per,textdiv);
2246 var ctx = canvas.getContext('2d');
2248 ctx.fillStyle = canvas_bgcolor;
2249 ctx.fillRect(0,0,canvas_width,canvas_height);
2251 ctx.clearRect(0,0,canvas_width,canvas_height);
2254 B2T = ctx.createLinearGradient(pw+ps,ph+ih+1,pw+ps+ps,ph+ih+1);
2257 ctx.fillStyle = B2T;
2258 ctx.beginPath();
2259 ctx.moveTo(pw+ps,ph+ih);
2260 ctx.lineTo(pw+ps,ph+ih+ps);
2261 ctx.lineTo(pw+ps+ps,ph+ih);
2262 ctx.closePath();
2263 ctx.fill();
2264 B2T = ctx.createLinearGradient(pw+ps+ps,ph+ih,pw+ps+ps,ph+ih+ps);
2267 ctx.fillStyle = B2T;
2268 ctx.beginPath();
2269 ctx.moveTo(pw+ps+ps,ph+ih);
2270 ctx.lineTo(pw+iw,ph+ih);
2271 ctx.lineTo(pw+ps+iw,ph+ih+ps);
2272 ctx.lineTo(pw+ps,ph+ih+ps);
2273 ctx.closePath();
2274 ctx.fill();
2275 var B2T = ctx.createLinearGradient(pw+iw+1,ph+ps,pw+iw+1,ph+ps+ps);
2278 ctx.fillStyle = B2T;
2279 ctx.beginPath();
2280 ctx.moveTo(pw+iw,ph+ps);
2281 ctx.lineTo(pw+iw,ph+ps+ps);
2282 ctx.lineTo(pw+iw+ps,ph+ps);
2283 ctx.closePath();
2284 ctx.fill();
2285 B2T = ctx.createLinearGradient(pw+iw,ph+ps+ps,pw+iw+ps,ph+ps+ps);
2288 ctx.fillStyle = B2T;
2289 ctx.beginPath();
2290 ctx.moveTo(pw+iw,ph+ps+ps);
2291 ctx.lineTo(pw+iw,ph+ih);
2292 ctx.lineTo(pw+iw+ps,ph+ih+ps);
2293 ctx.lineTo(pw+iw+ps,ph+ps);
2294 ctx.closePath();
2295 ctx.fill();
2297 ctx.lineCap = "butt";
2298 ctx.lineWidth = lw/2;
2299 ctx.strokeStyle = "rgba(255,255,255,0.25)";
2301 ctx.fillStyle = "rgba(240,240,240,0.8)";
2302 ctx.strokeStyle = "rgba(255,255,255,1)";
2303 ctx.fillRect(pw,ph,iw,ih);
2306 ctx.beginPath();
2307 ctx.moveTo(pw+(i*dw),ph);
2308 ctx.lineTo(pw+(i*dw),ph+ih);
2309 ctx.stroke();
2312 ctx.beginPath();
2313 ctx.moveTo(pw,ph+(i*dh));
2314 ctx.lineTo(pw+iw,ph+(i*dh));
2315 ctx.stroke();
2317 ctx.lineWidth = lw;
2324 drawLine(ctx,pw,ph+ih-bh,bw,bh,dw,ChartData[i],hf,cc,canvas_nofill);
2326 ctx.beginPath();
2327 ctx.moveTo(pw,ph);
2328 ctx.lineTo(pw,ph+ih);
2329 ctx.lineTo(pw+iw+(lw/2),ph+ih);
2330 ctx.strokeStyle = "rgba(48,48,48,1)";
2331 ctx.stroke();
2332 ctx.lineWidth = lw/2;
2333 B2T = ctx.createLinearGradient(pw,ph+ih,pw,ph+ih+ps);
2337 ctx.strokeStyle = B2T;
2339 ctx.beginPath();
2340 ctx.moveTo(pw+(i*dw),ph+ih);
2341 ctx.lineTo(pw+(i*dw),ph+ih+ps);
2342 ctx.stroke();
2344 B2T = ctx.createLinearGradient(pw-ps,ph,pw,ph);
2348 ctx.strokeStyle = B2T;
2350 ctx.beginPath();
2351 ctx.moveTo(pw-ps,ph+(i*dh));
2352 ctx.lineTo(pw,ph+(i*dh));
2353 ctx.stroke();