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)?
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.
I'm happy to announce that CCC supports that :-)
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.
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.
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
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.
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
For "strokeStyle", use "transparent", not false :-)
For hiding the label as well try "yAxisLabel_visible": false