Home forums Using CanvasJS Memory issues with small interval & big value

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Priyanka M S 3 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21098

    vladimirs
    Member

    There is an issue if we set axis interval to a small value, and will have a much bigger actual value,
    Browser page is stuck or produce ugly graph result after long delay like this:

    for example, interval 1 and value 5 000 000:

    axisY:{
    title: “Metrics Values”,
    titleFontFamily: “verdana”,
    titleFontSize: 24,
    titleFontColor: “DarkCyan”,
    labelFontSize: 18,
    interval: 1
    },

    data: [
    {
    type: “column”,
    dataPoints: [
    { x: 1, y: 1 },
    { x: 2, y: 1.2 },
    { x: 3, y: 7.476 },
    { x: 4, y: 8.583 },
    ]
    },

    {
    type: “column”,
    dataPoints: [
    { x: 1, y: 24.951 },
    { x: 2, y: 124.039 },
    { x: 3, y: 5000000 },
    { x: 4, y: 6.918 },
    ]
    }
    ]

    Full sample is here: http://jsfiddle.net/flashback_ua/QwZuf/1327/

    I suppose it should be considered as a bug. As solution, it could be for example – in case if max value more than 1000 times of interval, then interval should be switched to auto.

    • This topic was modified 3 months, 1 week ago by  vladimirs.
    #21121

    Priyanka M S
    Member

    @vladimirs,

    To avoid overlapping of labels, interval is automatically calculated. When interval is set to 1, labels get rendered for every value within the axis range. In your case, labels get rendered for every value starting from 1 to 5000000 since the interval is set to 1, resulting in label overlapping and delay in rendering. However, interval for axes has to be set according to the range of input that’s been provided to the chart. Please refer to interval in our documentation.

    If max value more than 1000 times of interval, then interval should be switched to auto.

    Thanks for the suggestion. CanvasJS doesn’t ignore user provide inputs, except for the rare scenarios. However, if the interval is not set, it gets auto-calculated.

    __
    Priyanka M S
    Team CanvasJS

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

You must be logged in to reply to this topic.