Home Forums Chart Support display value on every fifth value on index label

display value on every fifth value on index label

Viewing 8 posts - 1 through 8 (of 8 total)
  • #28538

    I am trying to show value on every fifth value, most recent value and first value on chart.

    Not sure how to write formatter, below one is good for a qualified value only.

    indexLabelFormatter: function(e){
    if(e.dataPoint.y > 20)
    return e.dataPoint.y;
    else
    return “”;
    },

    #28561

    @sksingh20,

    Can you kindly share JSFiddle with your use-case and brief us further so that we can understand the scenario better and help you out?

    —-
    Manoj Mohan
    Team CanvasJS

    #28564

    Use case is… graph shows value of temperature and humidity every 10-15 mins.. and graphs shows trend of 2 days or higher. So there are multiple data points on graph. requirement is to show measured value of temperature/humidity on graph. However every measured can’t be displayed on graph as so many value will make mess on graph. so requirement is to show first value, recent value highest value, lowest value of day etc..

    Above code is one of way for doing so but that is only for pre qualified value.

    #28589

    @sksingh20,

    Can you kindly share a pictorial representation or JSFiddle with your use-case, so that we can understand the scenario better and help you out?

    From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue or not able to understand the exact requirements or the solution that we provide may not work properly due to the variation in chart-options being used by you and us.

    Having a JSFiddle with your use-case helps us in figuring out the issue and suggesting an appropriate solution accordingly.

    —-
    Manoj Mohan
    Team CanvasJS

    #28592

    https://jsfiddle.net/canvasjs/QwZuf/
    In link shared by you … I am looking for y value to be displayed on chart for most higher value of x.
    Like in specific case to this jsfiddle link , I am looking for y value on chart for highest x value i.e, 90.

    json data format is {“x”: 1583503872000, “b”: 14, “d”: 9, “c”: 1, “a”: 93, “y”: 306}

    #28593

    Portal weblink is http://skras.ddns.net/mist.html, where this data needs to be displayed

    #28616

    @sksingh20,

    In link shared by you … I am looking for y value to be displayed on chart for most higher value of x.
    Like in specific case to this jsfiddle link , I am looking for y value on chart for highest x value i.e, 90.

    You can achieve this by looping through the dataPoints to find the maximum x-value and adding indexLabel to the dataPoint that has highest x-value as shown in this JSFiddle.

    If this doesn’t fulfill your requirements, kindly create JSFiddle with your use-case, so that we can understand the scenario better and help you out?

    From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue or not able to understand the exact requirements or the solution that we provide may not work properly due to the variation in chart-options being used by you and us.

    Having a JSFiddle with your use-case helps us in figuring out the issue and suggesting an appropriate solution accordingly.

    —-
    Manoj Mohan
    Team CanvasJS

    #28628

    Thank You. You got it right. Thank you for giving solution.

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

You must be logged in to reply to this topic.