[ 3 posts ]

Sami Alajrami

  • Username: sami
  • Joined: Tue Jul 10, 2012 4:41 am
  • Posts: 1
  • Offline
  • Profile

Is there any smart scaling support for values axes in charts

Post Posted: Tue Jul 10, 2012 4:51 am
+0-
I'm using charts to draw histogram chart, up to some point it works fine, but when the number of bins (hence the number of labels) increases, the labels starts to overlap and the whole chart become useless. Is there any way to fix this? for example specifying fixed number of bin labels to be displayed instead of displaying all the labels.

By the way, this is provided automatically in Google charts api.

Alberto Santini

YUI Contributor

  • Offline
  • Profile
Tags:

Re: Is there any smart scaling support for values axes in ch

Post Posted: Tue Jul 10, 2012 7:08 am
+0-
Hello Sami.

You need to style the axis with count of the majorUnit.
http://yuilibrary.com/yui/docs/api/clas ... ttr_styles

See the threads:
viewtopic.php?f=92&t=8803
viewtopic.php?f=92&t=8693

Hope that helps,
IceBox

Tripp Bridges

YUI Developer

  • Username: tripp
  • Joined: Wed Jan 07, 2009 1:54 pm
  • Posts: 435
  • GitHub: tripp
  • Gists: tripp
  • YUI Developer
  • Offline
  • Profile

Re: Is there any smart scaling support for values axes in ch

Post Posted: Tue Jul 10, 2012 8:35 am
+0-
Specifying a majorUnit count will work for a value axis (Numeric/Stacked) and the TimeAxis. It will not work for the CategoryAxis. The category axis is designed to have a 1:1 relationship with the data and has no notion of a majorUnit count. That said, hiding overlapping axis labels might be a useful addition. Please feel free to file a ticket for this or any other enhancement you would like to see.

Additionally, if your axis is horizontally aligned, you can consider changing the rotation of the axis labels to allow for more labels to fit on the axis. The below examples show how this can be done.
http://yuilibrary.com/yui/docs/charts/charts-axisupdate.html
http://yuilibrary.com/yui/docs/charts/charts-objectstyles.html


Thanks,
Tripp
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum