hide axis (ticker) labels

861 views
Skip to first unread message

Kevin Ortman

unread,
Mar 24, 2013, 11:52:49 AM3/24/13
to dygraph...@googlegroups.com
Hi all,
I am creating thumbnail graphs and was looking for a way to hide all generated x and y axis ticker labels.  I was not able to find an example of how to do this, but after tweaking I came up with the following.  Is there a better way?  Hopefully this info can help others.

new Dygraph(
                            placeholder.get(0),
                            graphData,
                            {
                                axes: {
                                    x: {
                                        ticker: function() {
                                            return [];
                                        }
                                    },
                                    y: {
                                        ticker: function() {
                                            return [];
                                        }
                                    }
                                },
                                connectSeparatedPoints: true,
                                labels: labels,
                                showLabelsOnHighlight: false,
                                width: 480,
                                height: 320
                            }
);

Thanks,
Kevin


Kevin Ortman

unread,
Mar 24, 2013, 12:14:50 PM3/24/13
to dygraph...@googlegroups.com
Also found that axisLabelFormatter suites this purpose.
This may be a better solution (?)

    axisLabelFormatter: function() {
        return '';

Dan Vanderkam

unread,
Mar 24, 2013, 12:34:48 PM3/24/13
to dygraph...@googlegroups.com
This example may be helpful:
http://dygraphs.com/tests/unboxed-spark.html
> --
> You received this message because you are subscribed to the Google Groups
> "dygraphs-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dygraphs-user...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Andrew Watkins

unread,
Mar 21, 2016, 6:03:07 PM3/21/16
to dygraphs-users
The reply given by danvk is uses an outdated api.  If you want to remove axis labels entirely here's what I've found worked:

  axes : { 
    x :  { 
        drawAxis : false,
        drawGrid: false,
      }
    }, 
   y :  { 
        drawAxis : false,
        drawGrid: false,
      } 
    }, 
Reply all
Reply to author
Forward
0 new messages