Welcome Guest Search | Active Topics |

Reasonable amount of labels for logarithmic y-axis
Vince
#1 Posted : Thursday, June 6, 2013 6:53:36 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/24/2013(UTC)
Posts: 16

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hi there,

I have values somewhere between 40 and 60 and want to display them using a log-axis but the labels are only on lines, which are powers of the logbase. It looks like this:

As you can see, there are plenty lines where a label could be to make it look a bit better. Is there a way to achieve this?

Ivan
#2 Posted : Thursday, June 6, 2013 11:51:44 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
You can do this with the axis.interval option. Try using this code:

Code:
  axes: [
                        {
                            type: 'linear',
                            location: 'right',
                            logarithmic: true,
                            logBase: 2,
                            interval: 0.2,
                            labels: {
                                stringFormat: '%.1f'
                            },
                            minorGridLines: { interval: 2, strokeStyle: 'red' }
                        }
                      ],
Best,
Ivan Petrov
jqChart Inc.
Vince
#3 Posted : Friday, June 7, 2013 12:28:54 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/24/2013(UTC)
Posts: 16

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hey Ivan,

thanks for that quick answer. Though I'm not quite getting how, the combination of minorGridLines and interval makes it look good :-)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.062 seconds.