JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>

JavaScript

var chart = new CanvasJS.Chart("chartContainer", {
  title: {
    text: "Changing Zoom/Pan Button Title"
  },
  zoomEnabled: true,
  axisX: {
    viewportMinimum: 3
  },
  rangeChanged: function() {
  	changeTitleForZoomPanButton(button);
  },
  data: [{
    type: "area",
    dataPoints: [
      { x: 1, y: 71 },
      { x: 2, y: 55 },
      { x: 3, y: 50 },
      { x: 4, y: 65 },
      { x: 5, y: 105 },
      { x: 6, y: 68 },
      { x: 7, y: 28 },
      { x: 8, y: 34 },
      { x: 9, y: 14 }
    ]
  }]
});
chart.render();

function changeTitleForZoomPanButton(button) {
	button.title = button.getAttribute("state") === "zoom" ? "Zoom Mode" : "Pan Mode";
}

var button = document.getElementsByClassName("canvasjs-chart-toolbar")[0].childNodes[0];
changeTitleForZoomPanButton(button);

button.addEventListener("click", function() {
    changeTitleForZoomPanButton(this);
});

window.addEventListener("resize", function() {
	changeTitleForZoomPanButton(button);
});