Home forums Using CanvasJS How to make X axis ajust to data?

This topic contains 2 replies, has 2 voices, and was last updated by  roberto_imai 1 week, 1 day ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14890

    roberto_imai
    Member

    Hi,

    I’m trying out the solution, but my plot x axis isn’t adjusting to the amount of data that I have automatically.
    For example, I have 1000 data points, but the X axis defaults to over 5000.
    So, my plot gets squished to the side and I get a whole big area with nothing in it.
    How do I make it adjust to my number of data points automatically?

    #14891

    Suyash Singh
    Moderator

    @roberto_imai,

    Can you please create a jsfiddle reproducing the the issue that you are facing so that we can look into your code and help you out better.

    ___
    Suyash Singh
    Team CanvasJS

    #14901

    roberto_imai
    Member

    Never mind.
    I hacked it by using a global variable and getting the count of datapoints when it is parsing the CSV and using that to dynamically set the maximum axisX value.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.