Black Lives Matter. Please consider donating to Black Girls Code today.

Name not appearing for one trace

I have my code like this :

  if (response.data.apiName) {
    $scope.metricsData = response.data;
    traceArray = [];
    for (var k = 0; k < response.data.apiName.length; k++) {
      
      traceJson = {
        x: ["Services"],
        y: [response.data.weight[k] * 100],
        type: 'bar',
        text: response.data.totalCount[k],
        textposition: 'auto',
        hoverinfo: 'y',
        name: response.data.apiName[k],
        marker: {
          // color: randomcolor,
          opacity: 0.6,
          line: {
            // color: randomcolor,
            width: 1.5
          }
        }
      };
      traceArray.push(traceJson)
    }

Also, if I am using hoverinfo:x+y+name, it works but the name doesn’t show all the characters as it is long.
I am already using text so how to manage if I want to display the full name.

Hi @yash1 welcome to the forum! You can set the layout['hoverlabel']['namelength] https://plotly.com/javascript/reference/#layout-hoverlabel-namelength to a large value so that the whole name appears.