15,797,801 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12312733 (Top 8 by date)
Member 12312733
28-Feb-16 14:02pm
View
I want to fetch records in javascript variables.
Member 12312733
23-Feb-16 8:13am
View
Alright, Thank you
Member 12312733
23-Feb-16 8:08am
View
I want user to input lets suppose his name, that name will be matched from the database, and then "distance" will be used as width of line.
(my database has 2 columns. Lets say name, distance)
Member 12312733
23-Feb-16 5:32am
View
I have already fetched data from database using ajax. But i am not sure, how can i use that fetched data to draw line. As in below, i want to use database data to make lines accordingly.
e.beginPath();
e.strokeStyle = "Black";
e.lineWidth = width;
e.moveTo(125, 125);
e.lineTo(X[i], Y[i]);
e.stroke();
Member 12312733
16-Feb-16 14:20pm
View
alright, Thanks
Member 12312733
15-Feb-16 20:31pm
View
Hello,
I want to access my database values, and draw lines according to the departure time of the user. and the thickness of the lines is basically the price, means higher the price, thicker is the line.
"Price" is saved in my database. Now, how am i supposed to use that ?
<canvas id="canvas" width=500 height=500></canvas>
<script>
var canvas = document.getElementById("canvas");
var e = canvas.getContext("2d");
var cw = canvas.width;
var ch = canvas.height;
draw(e, 40);
function circle(e, color, x, y, radius, startAngle, endAngle, clockwise) {
if (arguments.length < 9) return alert("Not enough arguments.\nThe function \"circle\" requires 9 arguments\nYou provided only " + arguments.length + ".");
e.beginPath();
e.arc(x, y, radius, startAngle, endAngle, clockwise);
e.strokeStyle = color;
e.stroke();
}
function draw(e, radius) {
var deg360 = Math.PI * 2;
circle(e, "#00688B", 125, 125, 125, deg360, 0, deg360, true);
e.fillStyle = '#00688B';
e.fill();
circle(e, "#0099CC", 125, 125, 110, deg360, 0, deg360, true);
e.fillStyle = '#0099CC';
e.fill();
circle(e, "#63D1F4", 125, 125, 95, deg360, 0, deg360, true);
e.fillStyle = '#63D1F4';
e.fill();
circle(e, "#05EDFF", 125, 125, 80, deg360, 0, deg360, true);
e.fillStyle = '#05EDFF';
e.fill();
circle(e, "#BFEFFF", 125, 125, 65, deg360, 0, deg360, true);
e.fillStyle = '#BFEFFF';
e.fill();
var X = [50, 65, 80, 95, 150, 170, 160];
var Y = [50, 65, 95, 70, 125, 170, 190];
//var Xlast = [50, 65, 95, 70, 125, 170, 190];
//var Ylast = [120, 165, 195, 170, 125, 170, 190];
var Xcent = 125;
var Ycent = 125;
for (var i = 0; i < X.length; ++i) {
var width = 0.5 + i / 2;
e.beginPath();
e.strokeStyle = "Black";
e.lineWidth = width;
e.moveTo(Xcent, Ycent);
//e.moveTo(0, 0);
e.lineTo(X[i], Y[i]);
e.stroke();
}
circle(e, "#E6E8FA", 125, 125, 50, deg360, 0, deg360, true);
e.fillStyle = '#E6E8FA';
e.fill();
e.fill();
e.fillStyle = "black"; // font color to write the text with
e.font = radius * 0.18 + "px arial";
e.textBaseline = "middle";
e.textAlign = "center";
e.fillText(0, radius, e);
for (num = 0; num < 25; num++) {
ang = num * Math.PI / 12;
e.translate(125, 125);
e.rotate(ang);
e.translate(0, -radius);
e.rotate(-ang);
e.fillText(num.toString(), 0, 0);
e.rotate(ang);
e.translate(0, +radius);
e.rotate(-ang);
e.setTransform(1, 0, 0, 1, 0, 0);
}
Member 12312733
15-Feb-16 18:17pm
View
I am not finding any way to connect my database so that i can fetch values from database in canvas.
Member 12312733
15-Feb-16 11:17am
View
Deleted
I have made a clock on canvas.
Now, I want users to enter the time.
That time would be stored in my database.
After multiple calculations from database stored values , i need to draw lines on the circle which gives the maximum time to reach.
Show More