y.ticks is not a function
See original GitHub issueI use YAxis as code:
<View style={{ flexDirection: 'row', height: 200, paddingVertical: 16 }}>
<YAxis
data={data}
yAccessor={({ index }) => index}
scale={scale.scaleBand}
contentInset={{ top: 10, bottom: 10 }}
spacing={0.2}
formatLabel={(_, index) => data[ index ].label}
/>
<BarChart
style={{ flex: 1, marginLeft: 8 }}
data={data}
horizontal={true}
yAccessor={({ item }) => item.value}
svg={{ fill: 'rgba(134, 65, 244, 0.8)' }}
contentInset={{ top: 10, bottom: 10 }}
spacing={0.2}
gridMin={0}
>
<Grid direction={Grid.Direction.VERTICAL}/>
</BarChart>
</View>
But, it had error: y.ticks is not a function(In ‘y.ticks(numberOfTicks)’, ‘y.ticks’ is undefined
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
this.map.tick is not a function - Stack Overflow
this.map.tick is not a function ; "#myBarChartOdometer"); var ; Chart(graphTarget12, { type: 'bar' ; $data = Odometer ; $name = array ; $i=0 ......
Read more >Set or query y-axis tick values - MATLAB yticks - MathWorks
This MATLAB function sets the y-axis tick values, which are the locations along the y-axis where the tick marks appear.
Read more >D3.js axis.ticks() Function - GeeksforGeeks
The d3.axis.ticks() Function in D3.js is used to control which ticks are displayed by the axis. This function returns the axis generator.
Read more >scale.ticks / D3 - Observable
This method is often called indirectly by axis.ticks. scale.ticks returns an array ... The ticks depend on the scale's type and domain, but...
Read more >D3 Axes - D3 in Depth
This article covers axis orientation, transitions, number of ticks, custom tick ... When a D3 scale function is used to define an axis,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m having the same issue and it seems that the problem is in the way that
YAxisis doing comparisons between thescaleprop being passed to the component and thescale.scaleBrandused from thed3-scaledependency used in the library.This particular ternary operation
const ticks = scale === d3Scale.scaleBand ? values : y.ticks(numberOfTicks);is returning false if you passed ascale.scaleBranfrom anotherd3-scaleversion.To fix this, use the same
d3-scaleversion from the library which is1.0.6.I am facing the same exact problem 😦