Home Forums Chart Support Default range selector buttons behave unintuitively

Default range selector buttons behave unintuitively

Viewing 5 posts - 1 through 5 (of 5 total)
  • #61089

    By default CanvasJS adds “1m”, “3m”, “6m”, “YTD”, “1y”, “All” buttons at the top of the chart.

    Recently one of our testers noticed that the “YTD” (year to date) button wasn’t behaving as expected. Most people generally assume that when they click a YTD button that it will give them all the readings for the current year in progress. So if for example we are in 2025 then the range would always jump to 2025 and give you all the readings for this year.

    This is apparently not what the CanvasJS YTD button does. After some experimentation I realized that what it is doing instead is taking the current range’s “end date” and then moving the associated range’s “start date” to the beginning of the same year as the “end date”. Myself and others find this very unintuitive. This can be seen easily by looking at your default JSFiddle.

    The other range buttons appear to behave in a similar fashion. These are perhaps mildly less unintuitive as there are perhaps less expectations for how they should behave but nonetheless they too can be a bit confusing until you understand how they were designed.

    I would consequently propose that this confusion be addressed in some way by the CanvasJS team. Possible ways of improving this situation include: removing these buttons by default, improving their default label text so their functionality is more obvious, explaining their behavior in the documentation, changing their functionality to be just the “last 1m”, “last 3m”, etc. or some combination of these improvements. I’ll obviously leave this to your own judgement.

    For now, I am aware of how I can disable these buttons and will likely be removing them from our product.

    Regards,
    Chris

    #61091

    Chris,

    Thanks for your feedback! You’re correct, buttons like “1M” and “6M” adjust the start date relative to the current end date, keeping the end fixed. For example, “1M” shows data from one month before the end date to the end date. We will revisit our documentation to address this.

    We agree that the “YTD” behavior can be unintuitive and will revisit this in future releases.


    Vishwas R
    Team CanvasJS

    #61148

    Thanks Vishwas! I look forward to an eventual fix.

    – Chris

    #61196

    Chris,

    We have just released StockChart v1.13.0GA with this improvement. Please refer to this release blog for more information. Kindly download the latest version from Download Page & let us know your feedback.


    Vishwas R
    Team CanvasJS

    #61280

    Hi Vishwas,

    Thanks for the release to fix the YTD behavior. It is appreciated.

    Unfortunately, I still can’t use the 1M, 3M, etc. buttons because their behavior can also be unexpected based on their limited description. Based on the labelling a user might equally expect “1 month from selected start date”, “1 month from selected end date”, “1 month from first reading”, or “1 month from last reading”. Only in reading the documentation will they find out which and this isn’t ideal.

    Consequently, I will likely have to remove these buttons completely and implement my own.

    I would propose instead that these buttons should read “last 1M”, “last 3M”, etc. and they should always give the last 1 month, 3 months etc. of data from the current date which would at least be more expected based on the new labelling.

    You could equally change the label defaults to something like “1M before selected end date” and keep the existing behavior but I find this text a little long for a button. Maybe there could be a shorter way of saying the same thing but I can’t think of it at the moment.

    Thanks again anyway for the release.

    Regards,
    Chris

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

You must be logged in to reply to this topic.