ruby-on-rails - 样式 echarts - 无法修改标题颜色
问题描述
希望使用下面的图表,但无法将标题颜色更改为白色,将轴和轴编号更改为灰色(或白色)。这应该在深色背景之上。有人知道如何用 echarts 更改标题颜色吗?
<script type="text/javascript">
// based on prepared DOM, initialize echarts instance
var myChart = echarts.init(document.getElementById('main'));
// specify chart configuration item and data
var option = {
title: {
text: 'Total memebers of the club',
fontColor: 'white',
display: true,
position: 'bottom'
},
tooltip: {},
legend: {
data: ['Total member']
},
xAxis: {
data: ["11/2018", "12/2018", "01/2019", "02/2019", "03/2019", "04/2019"]
},
yAxis: {},
series: [{
itemStyle: {normal: {color: 'white'}},
name: 'Total',
type: 'bar',
data: [5, 384, 612, 2344, 4670, 9372]
}]
};
// use configuration item and data specified to show chart
myChart.setOption(option);
</script>
解决方案
试试这个。将其添加到“文本:”下,例如:
text: 'Total memebers of the club',
textStyle: {
color: '#ed2d2e'
}
推荐阅读
- git - 在 Eclipse eGit 中,我需要在拉入本地之前查看所有更改
- cakephp - CakePHP 烘焙模板控制器
- javascript - ThreeJS无法设置WebGLRenderer的domElement
- email - Salesforce 中使用 ClaimRow 的优惠券
- mysql - 将 SQlite 和 MySQL 与实体框架一起使用
- python - 如何让 VSCode 将 Python3 识别为我的默认值
- r - 如何重命名部分数据框中的列名?
- r - 如何向圆形直方图添加置信区间(von Mises 分布)
- python - PySpark:与.dropna()相反?
- intel - 向量加标量单精度