在图表底部添加一行字 [英] Adding a line of words towards the bottom of chart

查看:142
本文介绍了在图表底部添加一行字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在图表底部添加一行Country:Singapore Reporting Date:d / MMM / yy User:xxxxx。我应该如何继续?目前,我的代码如下。

I would like to add a line of words "Country: Singapore Reporting Date: d/MMM/yy User: xxxxx " towards the bottom of chart. How should I proceed? Currently, I have my codes as below.

   <script type="text/javascript">
  function renderChart(divId, chartType, chartTitle, chartData, categories) {

     var data = jQuery.parseJSON(chartData);
     var cat = jQuery.parseJSON(categories);
     console.log(cat);
     console.log(chartData);
     var options = createOption(divId, chartType, chartTitle, cat);
     options.series = [{
           allowPointSelect : true,
           data : data,
           showInLegend : true            
        }];
     var chart = new Highcharts.Chart(options);
  }

  function createOption(divId, chartType, chartTitle, categories) {
     var options = {
        colors : [ '#058DC7', '#50B432', '#ED561B', '#DDDF00',
              '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4' ],
        chart : {
           renderTo : divId,
           type : chartType
        },
        title : {
           text : chartTitle
        },
        xAxis : {
           categories : categories,
           showEmpty: false
        },
        yAxis: {
              showEmpty: false
          },
        series : []

     };

     return options;
  }


推荐答案

您可以使用标签渲染器,它允许在图表上添加自定义文本/对象。

You can use labels or renderer, which allow to add custom text / object on the chart.

这篇关于在图表底部添加一行字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆