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.

How to set X axis step

See original GitHub issue

Here is my options scales: { display: false, gridLines: { display: false }, yAxes: [ { display: false } ], xAxes: [ { gridLines: { display: false } } ] } How can I set step between X axis values?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
master-dodocommented, Dec 17, 2016

Maybe a related problem that I am having, in which I’m trying to figure out how to set my own step size on the x-axis with non-numeric labels (on Chart JS 2.0). I’m creating a stacked bar chart.

I can disable the scales.xAxes.ticks.autoSkip to false, but then I get all the labels (which I don’t want) When I set my own stepSize value, it doesn’t seem to register it - I think because my data labels are hard coded values and not numerical: labels: ["Jan-14","Feb-14","Mar-14","Apr-14","May-14","Jun-14","Jul-14","Aug-14","Sep-14","Oct-14","Nov-14","Dec-14",...] etc

I only want to see Jan and Jul labels spanning over years 2014-2016.

I also tried setting the xAxes.type to time, but it then doesn’t recognizes the labels I put in.

Any ideas to get around this?

In my JS fiddle I set autoSkip to true, but would ideally like the set up as explained above. my js fiddle: https://jsfiddle.net/duckdave/59qz03wg/

0reactions
etimbergcommented, Jan 28, 2017

It sounds like you’re creating a chart like https://github.com/chartjs/Chart.js/blob/master/samples/line/line.html but to be able to have a step (ie a numeric separation between values) you should create a chart more like https://github.com/chartjs/Chart.js/blob/master/samples/scatter/scatter.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change X axis step in Python matplotlib - Stack Overflow
I created a figure which shows a set of data and a histogram. What bugs me is, as shown below, the X-axis at...
Read more >
How to set "step" on axis X in my figure in Matplotlib Python ...
Steps · Create a list of data points, x. · Add a subplot to the current figure using subplot() method. · Set xticks...
Read more >
How to Set Axis Ticks in Matplotlib (With Examples) - Statology
You can use the following basic syntax to set the axis ticks in a Matplotlib plot: #set x-axis ticks (step size=2) ...
Read more >
Change the scale of the horizontal (category) axis in a chart
On the Format tab, in the Current Selection group, click the arrow in the box at the top, and then click Horizontal (Category)...
Read more >
Setting Axis scale steps - MATLAB Answers - MathWorks
You can hold and drag the graph to see those ticks. I used xlim() because somehow 0 was being trimmed out from the...
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