473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

how color a line in canvas

Hi Frnds,

I want to know about, how to use color in canvas in
javascript.
Bcoz im using canvas in javascript for plotting line graph,

I have plotted the linegraph, now i need to differentiate the
values, so i want to give different color for each line plotted. But i
dont know how to color a line ,

Can anyone tell me the solution?

Another i want to know, Can i ask these canvas doubts in this
javascript group. If i should ask these doubts means , where should im
ask?

Thanks&Rgrds..
Dinesh...

Sep 7 '06 #1
2 2476
wrote on 07 sep 2006 in comp.lang.javascript:
Hi Frnds,

I want to know about, how to use color in canvas in
javascript.
Bcoz im using canvas in javascript for plotting line graph,
Please write complete words, this is not SMS, there is room enough.

I have plotted the linegraph, now i need to differentiate the
values, so i want to give different color for each line plotted. But i
dont know how to color a line ,
I already answered your question here:
Subject: Re: how to simple line graph throygh CANVAS
Date: Wed, 06 Sep 2006 08:25:55 +0200
Newsgroups: xs4all:comp.lang.javascript

wrote on 06 sep 2006 in comp.lang.javascript:
> Im want to draw a linegraph dynamically through canvas.
So I want a sample line graph code and how to draw lines
between pixels.

Can anyone give me some sample code on canvas for these
things
[...]
>
If you mean your window by canvas:

<http://devrijehuisarts.org/test/jsgraph.asp>

So please study the code, and you will see how the lines are coloured.
Can anyone tell me the solution?
There is no "the" solution, there are many ways to Rome, start by
studying Javascript and CSS.
Another i want to know, Can i ask these canvas doubts in this
javascript group. If i should ask these doubts means , where should im
ask?
"Canvas" is not a word used in html, etc. Html in a browser is not a
paint programme.

You can ask about colours in a CSS NG, and about Javascript in this one,
but show first that you tried it yourself by showing some code.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 7 '06 #2


Evertjan. wrote:

"Canvas" is not a word used in html, etc. Html in a browser is not a
paint programme.
Firefox 1.5, Opera 9 and Safari (since 1.3?) do support a canvas element
in HTML and XHTML that has the sole purpose of exposing a drawing API to
script:
<http://developer.mozilla.org/en/docs/Canvas_tutorial>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mickel Grönroos | last post by:
Hi, I'm trying to put an Tkinter.Entry of fixed size onto a specific location on a canvas using the place manager. The idea is that one can double-click a rectangle object on a canvas to get an...
1
by: Ben Bush | last post by:
I tested the following code and wanted to make oval 2 become red after I hit the enter key but though the code did not report error, it did not change. from Tkinter import * root=Tk()...
2
by: balakrishnan.dinesh | last post by:
Hi, Will any one suggest a way for implementing the line graphs in various browsers without compatability issues. I mean canvas can be used in Mozilla FireFox 1.5 for drawing objects but where as...
1
by: balakrishnan.dinesh | last post by:
hi frnds, Im want to draw a linegraph dynamically through canvas. So I want a sample line graph code and how to draw lines between pixels. Can anyone give me some sample code on canvas for...
4
by: skanemupp | last post by:
mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif') w.create_image(10, 10, image = mapq, anchor = NW) after doing this is there any possibility of getting the characteristics of...
4
by: moondaddy | last post by:
I have a wpf project where I use a canvas to drag shapes around. when I drag a shape beyond the right or bottom side I get scrollbars which is good. I also get scrollbars when I zoom in and a...
1
by: Linda Liu[MSFT] | last post by:
Hi George, I have downloaded your sample project and built it on my machine. When I start the application and click the Button on the window, I get an InvalidCastException on the line of code...
3
by: goldreads | last post by:
Hey guys, I've been putting together a line graph in Image_Graph. And I can't seem to find an answer to change the layout of few things. Here is my graph: http://www.goldreads.com/test.png ...
19
by: david.karr | last post by:
If in my CSS I set the "background-color" property on the "body" element, it only covers the background of the elements defined in the body, up to the current width and height of the page. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.