Home forums Report Bugs Zoom not working with many data points?

This topic contains 3 replies, has 2 voices, and was last updated by  Indranil Deo 4 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20031

    ehudg
    Member

    Hi

    I have a graph that works fine with 89 data points, but fail to work with 255 data points. The problem is that the zoom does not work when having 255 datapoints.

    The code is the same in both case, could you please direct me to the issue?

    Many thanks.

    Code:

    `unction RenderTurningGraph() {
    var turningData = data;
    chartTurning = new CanvasJS.Chart(“trolley-turning-graph”, {
    title: {
    text: “Turning”
    },
    zoomEnabled: true,
    zoomType: “xy”,
    exportEnabled: true,
    axisY: {
    minimum: -50,
    maximum: 50,
    title: ‘Turning’,
    titleFontSize: 20,
    stripLines: [
    {
    value: $(‘#threshold-data’).data(‘turning-min’),
    color: ‘#222’
    },
    {
    value: $(‘#threshold-data’).data(‘turning-max’),
    color: ‘#222’
    }
    ],
    gridThickness: 1
    },
    axisX: {
    title: ‘Time [Days|Hours]’,
    titleFontSize: 20,
    labelFormatter: function (e) {
    //
    }
    },
    toolTip: {
    contentFormatter: function (e) {
    return e.entries[0].dataPoint.Label + “: ” + e.entries[0].dataPoint.y + ‘°’ +
    ‘<p>’ + e.entries[0].dataPoint.SampleTime + ‘</p>’;
    }
    },
    data: [
    {
    type: “line”,
    markerSize: 7,
    dataPoints: turningData
    }
    ]
    });

    chartTurning.render();
    }

    #20034

    Indranil Deo
    Member

    @ehudg,

    Can you please create a jsfiddle reproducing the issue with sample data so that we can understand your code better and help you out.

    ___________
    Indranil Deo,
    Team CanvasJS

    #20045

    ehudg
    Member

    Hi

    I’ve created the fiddle:

    zoom not working

    #20051

    Indranil Deo
    Member

    @ehudg,

    The behavior is designed such that zooming is limited upto a certain region, so the user doesn’t end up zooming into a blank-region (region with no dataPoints). To zoom into a certain region, there should be a minimum of 3-4 dataPoints.

    In your case, the zoom doesn’t work as there are less than 3-4 dataPoints over the Axis Y.

    We will reconsider this behavior for future releases.

    ___________
    Indranil Deo,
    Team CanvasJS

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

You must be logged in to reply to this topic.