第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

這是來自 chart.js 的自定義問題

這是來自 chart.js 的自定義問題

慕工程0101907 2021-06-22 09:05:45
我用的是chart.js,但是沒有應(yīng)用css。我用的是chart.js,但是我不知道如何調(diào)整位置和大小以及移動標簽。<div class="penpal-count-box"><div class="col">    <h5 style="padding-top:2%"><i class="fa fa-globe" style="color:blue">   </i>&nbsp;@lang('home/main.penpal_count')    </h5>    <hr>    <canvas id="myChart"></canvas>  </div></div><script>var ctx = document.getElementById('myChart').getContext('2d');var myChart = new Chart(ctx, {    type: 'pie',    data: {        labels: ['??', '??'],        datasets: [{            label: '# of Votes',            data: [{                    !!$koreaSenderCount!!                },                {                    !!$japanSenderCount!!                }            ],            backgroundColor: [                'red',                'blue',            ],        }]    },    options: {        maintainAspectRatio: false,    }});</script><style> canvas {    width: 400px !important;    height: 170px !important;    margin-bottom: 3%;}</style>我想從側(cè)面取下標簽并將其設(shè)置為適合上方的 div。我的目標是以類似于第二張圖片的方式應(yīng)用它。
查看完整描述

1 回答

?
慕無忌1623718

TA貢獻1744條經(jīng)驗 獲得超4個贊

試試這個,這里為標簽添加了位置,來自圖表 js,圖例標簽文檔

var myChart = new Chart(ctx, {

    type: 'pie',

    data: {

        labels: ['??', '??'],

        datasets: [{

            label: '# of Votes',

            data: [{

                    !!$koreaSenderCount!!

                },

                {

                    !!$japanSenderCount!!

                }

            ],

            backgroundColor: [

                'red',

                'blue',


            ],

        }]

    },

    options: {

        maintainAspectRatio: false,

        legend: {

          position:'right',   // from this line you can get your labels in right direction    

        },

    }

});


查看完整回答
反對 回復(fù) 2021-06-24
  • 1 回答
  • 0 關(guān)注
  • 179 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號