US and Worldwide: +1 (866) 660-7555
Results 1 to 9 of 9

Thread: Definition of tick interval in line/bar charts

  1. #1
    Join Date
    Aug 2008
    Posts
    1

    Default Definition of tick interval in line/bar charts

    Currently I have low numbers in some of my line/bar charts and they are displayed with tick values ranging from 0 to 5 in 0.1 or 0.5 intervals.
    Does anyone know how I can make sure that the tick intervals displayed on my charts will be integers (not just the formatting of the tick values)?

    Thanks!

  2. #2
    Join Date
    Oct 2013
    Posts
    28

    Default

    This seems like a very basic use case for bar charts but I've also been unable to get this to work. It was suggested on IRC to use an extension point but so far no luck.

    By way of example, lets say I've got a poll where respondents can choose one of three answers. All of the results are whole numbers: eg. 3 people might answer with option (A), 2 with (B) and 4 with (C). Showing a bar graph of these results using floats is counter-intuitive and clutters the display.

    Any suggestions would be most welcome - I've wasted a number of hours looking through unanswered posts, and page after page of irrelevant information.

  3. #3
    Join Date
    Mar 2012
    Posts
    462

    Default

    I'm happy to announce that CCC supports that :-)

    orthoAxisTickExponentMin: 0

  4. #4

    Default

    Hello. I'm having some trouble with this as well. I've tried this function in pre execution, also post fetch and anywhere else i can think of sticking it but it is not making any change to my line chart tick intervals.

    function(){
    this.chartDefinition.orthoAxisTickExponentMin=0;
    this.chartDefinition.orthoAxisTickExponentMax=0;
    }

    Any suggestions?

  5. #5
    Join Date
    Mar 2012
    Posts
    462

    Default

    That should be the right place to put it. In code, like you did, or you can just fill in the CDE properties of the chart.

    The assumptions were:
    * CCC version 2
    * Numeric axis
    * Want to control the "ortho" axis (the vertical axis, when the chart orientation is "vertical"). If not the case, the prefix "base" should be used instead.

  6. #6

    Default

    I'm using ccc1 (old cde version) but the other assumptions are true. I tried adding a 3rd line just to test the function in pre execution

    this.chartDefinition.orthoFixedMax = 100;

    and this line does set the max value to 100, just the TickExponent lines do nothing

  7. #7
    Join Date
    Mar 2012
    Posts
    462

    Default

    In the "past", some used to hide fractional ticks dynamically using ?some? extension point, like yAxisTick_visible or _strokeStyle, and the same for the label, if visible is not used. Not sure, exactly.
    Not perfect, but did the job for some cases.

  8. #8

    Default

    Thanks, i've tried extension point yAxisMinorTicks_strokeStyle = false and it hides the minor ticks but the fractions are still there. I'll revisit this one later I think but still open to suggestions

  9. #9
    Join Date
    Mar 2012
    Posts
    462

    Default

    For "strokeStyle", use "transparent", not false :-)
    For hiding the label as well try "yAxisLabel_visible": false

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •