DOT Line Visible

In Existing Chart, red dotted line should be visible based on the values entered by User, For Example : if user enters 50 in the Text box, red dotted line should come horizontal to 50 
1 answers

Hi Sindhu,


There are 2 ways you can solve this:

  1. Using the data attribute you can add another line whose datapoints consists of (x0, {userYValue}), (x1, {userYValue}), where x0 is your lowest x value and x1 is your highest x value.
  2. Using the layout attribute with shapes as follows:
        "shapes": [
                "line": {
                    "color": "rgb(255, 0, 0)",
                    "dash": "dash",
                    "width": 2
                "type": "line",
                "x0": 0,
                "x1": 1,
                "xref": "paper",
                "y0": {userYValue},
                "y1": {userYValue}

    In this instance x0 should be 0 and x1 should be 1 as this references the graph domain (due to the xref = paper)