By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,567 Members | 1,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,567 IT Pros & Developers. It's quick & easy.

how color a line in canvas

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a


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 discussion thread is closed

Replies have been disabled for this discussion.