谷歌图表如何修复连字符转换为 -

时间:2016-09-09 23:05:52

标签: google-visualization

在我的数据数组中我有

'Member - joined 2008'

然而,当我加载我的图表时,工具提示会显示–

enter image description here

如何修复它以获取连字符而不是为我拼写的HTML实体?

2 个答案:

答案 0 :(得分:1)

似乎在这里工作正常......

google.charts.load('current', {
  callback: drawChart,
  packages:['corechart']
});

function drawChart() {
  var data = google.visualization.arrayToDataTable([
    ['Year', 'Sales', {role: 'tooltip', type: 'string'}],
    ['2013',  1000, 'Member - joined 2005'],
    ['2014',  1170, 'Member - joined 2006'],
    ['2015',  660,  'Member - joined 2007'],
    ['2016',  1030, 'Member - joined 2008']
  ]);

  var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
  chart.draw(data);
}
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>

答案 1 :(得分:0)

问题与Google图表无关。

这是由我正在使用的php引起的,特别是优雅主题的Divi。