question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line Chart Interval - Ticks

See original GitHub issue

Hello i am new with this ,

<LineChart width={600} height={300} data={data}
            margin={{ top: 5, right: 30, left: 20, bottom: 5 }}>
                        <XAxis dataKey="cycle" interval={50} type="number" domain={['dataMin', 'auto']} />/>
                        <YAxis tickSize={10} ticks={[0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35]} />
                        <CartesianGrid strokeDasharray="3 3" />
                        <Tooltip />
                        <Legend />
                        <Line type="monotone" dataKey="max" stroke="#8884d8" />
                        <Line type="monotone" dataKey="avg" stroke="#82ca9d" />
 </LineChart>

First using for YAxis: using tickSize=10 do not show all ticks it show only 6 of them in this example it show

0.05, 0.1, 0.15, 0.2, 0.25, 0.35 Expected 0.05, 0.1, 0.15, 0.2, 0.25,0.30, 0.35 Why this does not work?

Second for XAxis in my data the min cycle is 100, how make it so the tick will go something like this

100,150,200,250,300,350…etc

what am i missing? i cannot get it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
juampickcommented, Aug 31, 2017

I’ve just solved doing this:

<YAxis
          type="number"
          yAxisId="right"
          orientation="right"
          domain={[0, 200]}
          ticks={[0, 10, 20, 30, ...., 200]}
          allowDecimals={true}
          allowDataOverflow={true}
          stroke={lineSelected.stroke}
          interval={0}/>

Thanks! Hope this helps, I think that the magic was the: interval={0}, I’ve tested before with interval="0" and didn’t work.

2reactions
kimjunycommented, Jun 22, 2017

@Shadowman4205 Did you solve this problem? I’m having same problem. Some ticks are just missing even I specified explicitly which ticks to show.

Read more comments on GitHub >

github_iconTop Results From Across the Web

xAxis.tickInterval | highcharts API Reference
Specific tick interval in axis units for the minor ticks. On a linear axis, if "auto" , the minor tick interval is calculated...
Read more >
Change the scale of the horizontal (category) axis in a chart
To change the interval between axis labels, under Interval between labels, click Specify interval unit, and then in the text box, type the...
Read more >
Major and Minor Tick Marks - chartpg
There are three minor tick intervals (Density) between each major tick mark. The tick marks are twice as long and are drawn in...
Read more >
Intervals | Charts - Google Developers
Google Charts can display intervals around a series. They might be used to portray confidence intervals, minimum and maximum values around a value,...
Read more >
Axis Ticks - Gridline and Label Spacing (Interval) - SciChart
Axis Ticks, Labels and Grid Lines In SciChart.js, the Ticks are small marks around the chart on an axis. There are Minor and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found