Search code examples
amchartsamcharts4

increase Stroke opacity of Zero line in AmCharts


enter image description here

As we can see I have one Bar chart with Positive and Negative bars. In the Middle on the 0th scale, there is one line that you can hardly see. I want to increase its opacity. So, I want to increase the opacity of XAxis or increase the opacity of the Zero line


Solution

  • I have found the Document for zero line, but I didn't find any specific solution. Trying by myself I found the way to correctly do it.

    and by the following code, we can increase the Zero line's opacity.

    valueAxis.renderer.baseGrid.strokeOpacity = 1;
    

    This is the JS version for JSON we can do the following

    {
      "yAxes": [{
        "type": "ValueAxis",
        "renderer": {
          "baseGrid": {
            "strokeopacity": 1
          }
        }
      }]
    }