在Django

时间:2017-11-29 17:52:12

标签: javascript css django chart.js

我正在尝试使用chart.JS使我的Django应用程序中的图表工作 但我有一些困难让它看起来很棒!

这里看起来如何: enter image description here

我有两个问题:

1)如何在图表标签中添加底部边距'团队测试"

2)如何将右侧图表居中放置

3)如何增加图表和标签的空间?

这是我的代码:

//graph 2//
    var info_process = new Chart(ctx2,{
      type: 'radar',
      data: {
        labels: labels_info,
        datasets: [{data: info_data,
                    label: team_name,
                    backgroundColor: "rgba(102, 187, 158, 0.2)",
                    borderColor: "rgba(102, 187, 158, 0.9)",
                    pointBackgroundColor: "black",
                    pointBorderColor: "#fff",
                    pointHoverBackgroundColor: "yellow",
                    pointHoverBorderColor: "rgba(179,181,198,1)",
                  }]
            },
        options: {
           scale: {display: true,
                   ticks: {
                     beginAtZero: true,
     }
                  },
           responsive:true,
           maintainAspectRatio: true,
          }
    });
    //end graph 2//

    //graph 3//
    var info_process = new Chart(ctx3,{
      type: 'radar',
      data: {
        labels: label_action,
        datasets: [{data: action_data,
                    label: team_name,
                    backgroundColor: "rgba(102, 187, 158, 0.2)",
                    borderColor: "rgba(102, 187, 158, 0.9)",
                    pointBackgroundColor: "black",
                    pointBorderColor: "#fff",
                    pointHoverBackgroundColor: "yellow",
                    pointHoverBorderColor: "rgba(179,181,198,1)",

        }]
            },
        options: {
           scale: {display: true,
                   ticks: {
                     beginAtZero: true,
     }
                  },
           responsive:true,
           maintainAspectRatio: true,
          }
    });
    //end graph 3//

0 个答案:

没有答案