react-vis icon indicating copy to clipboard operation
react-vis copied to clipboard

tickTotal is ignored in source code

Open georgesakourishan opened this issue 9 years ago • 4 comments

Looks like by default tickTotal is determined by size and all arguments being passed in are ignored.

georgesakourishan avatar Feb 15 '17 19:02 georgesakourishan

screen shot 2017-02-16 at 11 40 56 am screen shot 2017-02-16 at 11 41 08 am screen shot 2017-02-16 at 11 41 19 am

Hey @greatermeans

It looks like tickTotal is operating fine to me. Just like in d3 ticktotal is less a hard line specific number and more of a recommendation. If you need exact control over your ticks, I suggest passing in custom values for tickValues, and formatting however you need them via tickFormat.

mcnuttandrew avatar Feb 16 '17 19:02 mcnuttandrew

I'm gonna mark this as resolved, as this recomendation-rather-than-exatct-value is a feature not a bug. If i've missed something, feel free to re-open

mcnuttandrew avatar Feb 20 '17 06:02 mcnuttandrew

I suggest passing in custom values for tickValues

@mcnuttandrew trying this now, but the high-bound seems to cut off at the max value.

is there another way to ensure the axis displays the entirety of a certain range irrespective of the size of the data points?

here's what i mean. if it's not apparent, this is a chart using 2 HorizontalBarSeries

<XAxis
    title={'Portion of group (%)'}
    style={{
        ticks: { fill: 'white' },
        line: { display: 'none' }
    }}
    tickTotal={12}
    tickFormat={v =>
        v === 5 ? '≤ 5' : v}
    tickValues={[
        5,
        10,
        15,
        20,
        25,
        30,
        35,
        40,
        45,
        50,
        55,
        60
    ]}
/>

image

brandonmp avatar Mar 01 '18 15:03 brandonmp

I would like to know this as well. I have 8 values in my tickValues array on the XAxis but it only shows 7 (if I set tickTotal to 8) and much more if I don't set tickTotal at all.

Ventis avatar Apr 23 '18 09:04 Ventis