-1

タイトルは基本的にすべてを示しています。組織図/ツリーの子「ブランチ」にハイパーリンクを追加する必要があります。以下にコードを示します。

  <html>
  <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {packages:['orgchart']});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Name');
        data.addColumn('string', 'Manager');
        data.addColumn('string', 'link');
        data.addRows([
          [{v:'Manager', f:'Manager<div style="color:red; font-style:italic">Manager</div>'}, '', ''],
          [{v:'PS'}, 'Manager', 'https://developers.google.com/chart/interactive/docs/gallery/orgchart'],
          [{v:'ES'}, 'Manager', ''],
          [{v:'MSE'}, 'Manager', ''],
          [{v:'OEP'}, 'Manager', ''],
          ['', '', ''],
          ['', '', '']
        ]);
        var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
        chart.draw(data, {allowHtml:true});


      }
    </script>
  </head>

  <body>
    <div id='chart_div'></div>
  </body>
</html>
4

1 に答える 1

1
<html>
  <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {packages:['orgchart']});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Name');
        data.addColumn('string', 'Manager');
        data.addColumn('string', 'link');
        data.addRows([
          [{v:'Manager', f:'Manager<div style="color:red; font-style:italic">Manager</div>'}, '', ''],
          [{v:'PS', f:'<a href="#">PS</a>'}, 'Manager', 'https://developers.google.com/chart/interactive/docs/gallery/orgchart'],
          [{v:'ES', f:'<a href="#">ES</a>'}, 'Manager', ''],
          [{v:'MSE', f:'<a href="#">MSE</a>'}, 'Manager', ''],
          [{v:'OEP', f:'<a href="#">OEP</a>'}, 'Manager', ''],
          ['', '', ''],
          ['', '', '']
        ]);
        var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
        chart.draw(data, {allowHtml:true});


      }
    </script>
  </head>

  <body>
    <div id='chart_div'></div>
  </body>
</html>​
于 2013-08-09T17:55:23.873 に答える