Remove chart axis lines

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Remove chart axis lines

Bailo, John

 

Is there a way to remove the x-y axis lines in a dojo Charting.chart ?

 

 

John Bailo
Web Developer
_______________________________________________________________________________________________________________

Bowne Marketing & Business Communications
20017 72nd Ave S
Kent, WA 98032
Office: 253/437-7085
Cell: 253/217-2776

Fax: 253/872-5602

 

CONFIDENTIALITY NOTICE: The information in this Internet email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. 


_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
[hidden email]
http://dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Remove chart axis lines

Bailo, John

Ok, I found a way to do this, but it’s a real bad hack:

 

In the dojo.charting.Axis.render(), I commented out

 

//g.appendChild(line);

 

So nothing about axis gets “written” to the plot.

 


From: Bailo, John
Sent: Wednesday, January 10, 2007 2:53 PM
To: '[hidden email]'
Subject: Remove chart axis lines

 

 

Is there a way to remove the x-y axis lines in a dojo Charting.chart ?

 

 

John Bailo
Web Developer
_______________________________________________________________________________________________________________

Bowne Marketing & Business Communications
20017 72nd Ave S
Kent, WA 98032
Office: 253/437-7085
Cell: 253/217-2776

Fax: 253/872-5602

 

CONFIDENTIALITY NOTICE: The information in this Internet email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. 


_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
[hidden email]
http://dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Remove chart axis lines

mgriessler
In reply to this post by Bailo, John
I also needed to create a graph without any axis.  You can hide them by stroking the axis white, setting the from and to parameters to 0 and setting includezero to false, but they're still there, just invisible.  The hack I came up with was just, after render, to call a function that destroys the svg nodes that control the axis.  I did it on a bubble chart with two series so I'm sure the correct nodes differ from chart to chart, but each axis has two nodes: a g node and a rect node.

Here's the function I made, Rects 1 and 2 are the axis, 3 and 4 are the two margin boxes for the top and right.  g 1 and 2 are also axis related.  The dojo attr functions move the graph to the top left and fill the chart up, taking the space of the removed nodes.

function DestroyAxis(Chart) {
    var Rects = dojo.query("svg:first-of-type > rect");
    var g = dojo.query("svg:first-of-type > g");

    dojo.destroy(Rects[1]);
    dojo.destroy(Rects[2]);
    dojo.destroy(Rects[3]);
    dojo.destroy(Rects[4]);

    dojo.destroy(g[1]);
    dojo.destroy(g[2]);

    dojo.attr(Rects[0], "x", 0);
    dojo.attr(Rects[0], "y", 0);
    dojo.attr(Rects[0], "width", Chart.dim.width);
    dojo.attr(Rects[0], "height", Chart.dim.height);
}

This is a hack because each time you render you have to redo it, and as far as the Chart is concerned, everything is as it was before it was deleted, so it may play havoc with some events and such, I haven't tested it much but the benefit is that you don't have to change the dojo code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Remove chart axis lines

P, Rakesh Bangani
Dojo framework has examples of chart without axes in this example -
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/charting/tests/test
_axes.html

Hope this helps.

-rp


On 09/12/11 9:52 PM, "mgriessler" <[hidden email]> wrote:

> I also needed to create a graph without any axis.  You can hide them by
> stroking the axis white, setting the from and to parameters to 0 and setting
> includezero to false, but they're still there, just invisible.  The hack I
> came up with was just, after render, to call a function that destroys the
> svg nodes that control the axis.  I did it on a bubble chart with two series
> so I'm sure the correct nodes differ from chart to chart, but each axis has
> two nodes: a g node and a rect node.
>
> Here's the function I made, Rects 1 and 2 are the axis, 3 and 4 are the two
> margin boxes for the top and right.  g 1 and 2 are also axis related.  The
> dojo attr functions move the graph to the top left and fill the chart up,
> taking the space of the removed nodes.
>
> function DestroyAxis(Chart) {
>     var Rects = dojo.query("svg:first-of-type > rect");
>     var g = dojo.query("svg:first-of-type > g");
>
>     dojo.destroy(Rects[1]);
>     dojo.destroy(Rects[2]);
>     dojo.destroy(Rects[3]);
>     dojo.destroy(Rects[4]);
>
>     dojo.destroy(g[1]);
>     dojo.destroy(g[2]);
>
>     dojo.attr(Rects[0], "x", 0);
>     dojo.attr(Rects[0], "y", 0);
>     dojo.attr(Rects[0], "width", Chart.dim.width);
>     dojo.attr(Rects[0], "height", Chart.dim.height);
> }
>
> This is a hack because each time you render you have to redo it, and as far
> as the Chart is concerned, everything is as it was before it was deleted, so
> it may play havoc with some events and such, I haven't tested it much but
> the benefit is that you don't have to change the dojo code.
>
> --
> View this message in context:
> http://dojo-toolkit.33424.n3.nabble.com/Remove-chart-axis-lines-tp165918p35733
> 34.html
> Sent from the Dojo Toolkit mailing list archive at Nabble.com.
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> [hidden email]
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...