简体   繁体   English

如何翻译Google Analytics(分析)信息中心?

[英]How to translate Google Analytics dashboard?

I'm useing gadash library and I can't figure out how to translate chart legend labels. 我正在使用gadash库 ,但无法弄清楚如何转换图表图例标签。

In this example demo I get "Visitors, Visits, Pageviews". 此示例演示中,我得到“访问者,访问次数,综合浏览量”。 I'd like those translated. 我想要那些翻译。

My code: 我的代码:

  <script>
    var dataOverTime = new gadash.Chart({
        'last-n-days': 30,
        'chartOptions': {
            width: 700
        },
        'divContainer': 'dataOverTimeConfig',
        'type': 'LineChart',
        'query': {
          'dimensions': 'ga:date',
          'sort': 'ga:date',
          'metrics': 'ga:visitors, ga:visits, ga:pageviews',
          'ids' : TABLE_ID    
        },
        'chartOptions': {
            height: 300,
            legend: {position: 'bottom'},
            hAxis: {title:'Data'},
            curveType: 'function'
        }
    }).render();
  </script>

Is there any "locale" property I could add to the query? 我可以在查询中添加任何“语言环境”属性吗?

The answer was custom onSuccess function: 答案是自定义onSuccess函数:

        'onSuccess': function(resp) {              
            var dataTable = gadash.util.getDataTable(resp);
            // customized part
            dataTable.z[1].label = "First custom label";
            dataTable.z[2].label = "Second custom label";
            dataTable.z[3].label = "Third custom label";
            // end of customized part
            var chart = gadash.util.getChart(this.config.divContainer, this.config.type);
            gadash.util.draw(chart, dataTable, this.config.chartOptions);
            gadash.onSuccess();
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Analytics for Shiny Dashboard App - Google Analytics for Shiny Dashboard App Google Analytics(分析)信息中心响应无效 - Google analytics dashboard response not valid Google Analytics(分析)日期范围选择器/信息中心-如何针对自定义网络应用使用Google Analytics(分析)中的日期选择器? - Google Analytics date range picker / dashboard - How to use date picker present in Google Analytics for a custom web app? Google Analytics _setCustomVar - 我的信息中心中的奇怪数据 - Google Analytics _setCustomVar - strange data in my dashboard 使用自定义日期创建Google Analytics(分析)信息中心 - Creating Google Analytics Dashboard With Custom Dates Google AnalyticsAPI - 获取信息中心的网页浏览量 - Google Analytics API - Get Pageviews for Dashboard 如何将Google Analytics(分析)自动化仪表板中的批量数据逐月划分为数据 - How do I separate bulk data in my Google Analytics automated dashboard into month by month data 如何在我的网站上嵌入实时Google Analytics(分析)信息中心? - How do I embed a Real-Time Google Analytics Dashboard onto my website? 如何使用来自 Facebook 分析的数据显示仪表板 - How to display the dashboard with data from Facebook Analytics Google Analytics API JavaScript显示数据而无需登录仪表板上的用户 - Google Analytics API JavaScript show data without login to users on dashboard
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM