表題の通りなのですが、
@taguchi @yamamoto
のテキストの色を変えたいのですが、
やり方が見つけられませんでした。
colorやfontColor等で指定するのかな?と思い
色々と試してみましたが、変更できませんでした。
わかる方、教えていただきたいです。
html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <canvas id="my_chart"> Canvas not Supported/.... </canvas> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script> <script> (function () { "use strict"; var type = "horizontalBar"; // 横棒グラフ var data = { labels: [2010, 2011, 2012, 2013], datasets: [ { label: "@taguchi", data: [100, 200, 221, 350], // 実際のデータ backgroundColor: "skyblue", //棒の色 borderWidth: 0, // 枠線を消す }, { label: "@yamamoto", data: [-190, 500, 221, 30], backgroundColor: [ "hsla(90,80%,60%,0.3)", "hsla(180,60%,60%,0.3)", "hsla(270,60%,60%,0.3)", "hsla(360,60%,60%,0.3)", ], }, ], }; // 軸の範囲を決める var options = { // 軸の設定 scales: { xAxes: [ { stacked: true, //積み上げグラフの設定 }, ], // 縦軸の設定 yAxes: [ { stacked: true, // 積み上げグラフの設定 ticks: {}, }, ], }, }; var ctx = document.getElementById("my_chart").getContext("2d"); var myChart = new Chart(ctx, { type: type, data: data, options: options, }); })(); </script> </body> </html>
まだ回答がついていません
会員登録して回答してみよう