make unshaded line graphs

7 views
Skip to first unread message

tom

unread,
Aug 25, 2008, 6:57:24 PM8/25/08
to plotkit
After looking through the documentation, I do not think this is
possible, but I want to make sure.

Is it possible to make a line graph with the area under the line
unshaded?

Thanks

Prem Radhakrishnan

unread,
Aug 25, 2008, 9:04:25 PM8/25/08
to plo...@googlegroups.com
I did some customization of my own a while back to make this possible. I dont have a lot of time to explain it right now but you can take a look at this site

http://igs.indiana.edu/mes


If you look at the source of the first page you will see that there is a new type of chart called "lineonly"


The javascript files that are modified I believe are http://igs.indiana.edu/mes/javascript/plotkit/layout.js and http://igs.indiana.edu/mes/javascript/plotkit/canvas.js. I believe that I have commented places where I have made changes.
I am not sure if I modified Base.js or not. I did document this a long time back and I believe I had send it in as an enhancement but it was never incorporated, I know that this project is sort of on the backburner now for the principles.

Feel free to rip the code and use it, I have not updated the plotkit library since I modified it so it may not be uptodate, I worked on this project a while back.


Hope this helps
Cheers
Prem
--
A programmer is a device to turn coffee into code
http://www.39dn.com

Per Cederberg

unread,
Aug 26, 2008, 3:39:52 AM8/26/08
to plo...@googlegroups.com
Check out the plotkit-patches version of PlotKit. It supports
plain-line graphs for Canvas. I had to patch the drawing a bit to make
it look nice.

http://github.com/cederberg/plotkit-patches/tree/master

Or you could always try the same { shouldFill: false } option with
standard PlotKit.

http://media.liquidx.net/js/plotkit-doc/PlotKit.Renderer.html

Cheers,

/Per

tom

unread,
Sep 4, 2008, 7:08:30 PM9/4/08
to plotkit
I think I have figured it out. Its really simple actually. Apperently
there is a "shouldFill" option in the Renderer contructor.

http://media.liquidx.net/js/plotkit-doc/PlotKit.Renderer.html

I just set that to false and had a normal line graph. Thanks for the
help guys.

On Aug 26, 3:39 am, "Per Cederberg" <cederb...@gmail.com> wrote:
> Check out the plotkit-patches version of PlotKit. It supports
> plain-line graphs for Canvas. I had to patch the drawing a bit to make
> it look nice.
>
> http://github.com/cederberg/plotkit-patches/tree/master
>
> Or you could always try the same { shouldFill: false } option with
> standard PlotKit.
>
> http://media.liquidx.net/js/plotkit-doc/PlotKit.Renderer.html
>
> Cheers,
>
> /Per
>
> On Tue, Aug 26, 2008 at 3:04 AM, Prem Radhakrishnan
>
> <godsmustbcr...@gmail.com> wrote:
> > I did some customization of my own a while back to make this possible. I
> > dont have a lot of time to explain it right now but you can take a look at
> > this site
>
> >http://igs.indiana.edu/mes
>
> > If you look at the source of the first page you will see that there is a new
> > type of chart called "lineonly"
>
> > The javascript files that are modified I believe are
> >http://igs.indiana.edu/mes/javascript/plotkit/layout.jsand
> >http://igs.indiana.edu/mes/javascript/plotkit/canvas.js. I believe that I
> > have commented places where I have made changes.
> > I am not sure if I modified Base.js or not. I did document this a long time
> > back and I believe I had send it in as an enhancement but it was never
> > incorporated, I know that this project is sort of on the backburner now for
> > the principles.
>
> > Feel free to rip the code and use it, I have not updated the plotkit library
> > since I modified it so it may not be uptodate, I worked on this project a
> > while back.
>
> > Hope this helps
> > Cheers
> > Prem
>

tom

unread,
Sep 4, 2008, 7:11:26 PM9/4/08
to plotkit
Oops, I just saw that Per made the shouldFill suggestion already.
Should have checked here sooner :(

Per Cederberg

unread,
Sep 5, 2008, 3:56:42 AM9/5/08
to plo...@googlegroups.com
Ehm... I think that is what I said:

On Aug 26, 3:39 am, "Per Cederberg" <cederb...@gmail.com> wrote:
> Or you could always try the same { shouldFill: false } option with
> standard PlotKit.

But I still recommend you to give the PlotKit patches code a try. It
looks much nicer in this case if you are using Canvas.

Cheers,

/Per

Reply all
Reply to author
Forward
0 new messages