gpt4 book ai didi

javascript - 对 HighchartTable 中的 yAxis 标签和图表线进行着色

转载 作者:行者123 更新时间:2023-11-28 00:28:40 24 4
gpt4 key购买 nike

我开始使用 HighchartTable,在尝试自定义颜色和样式时,我似乎无法弄清楚如何更改 yAxis(左)标签的颜色或贯穿图表的引导线。这是我到目前为止所拥有的...

$(document).ready(function() 
{
$('table.highchart').bind('highchartTable.beforeRender', function(event, highChartConfig)
{
highChartConfig.chart.backgroundColor = '#191919';
highChartConfig.chart.borderWidth = '1';
highChartConfig.chart.borderColor = '#000000';
highChartConfig.chart.borderRadius = '8';
highChartConfig.chart.style = { "fontFamily": "Arial" };
highChartConfig.title.style = { "color": "#CCCCCC" };
highChartConfig.tooltip.style = { "color": "#000000" };
highChartConfig.tooltip.backgroundColor = '#CCCCCC';
highChartConfig.tooltip.borderWidth = '1';
highChartConfig.tooltip.borderColor = '#000000';
highChartConfig.tooltip.borderRadius = '8';
highChartConfig.xAxis.labels.style = { "color": "#CCCCCC" };
}).highchartTable();
});

这是当前的 JSFiddle:http://jsfiddle.net/Manvaril/cx1x1qpj

最佳答案

您必须为每个yAxis设置样式,因为可能存在multiple其中:

for (var i = 0; i < highChartConfig.yAxis.length; i++) {
highChartConfig.yAxis[i].labels.style = { "color": "#CCCCCC" };
}

See working fiddle here.

关于javascript - 对 HighchartTable 中的 yAxis 标签和图表线进行着色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29222471/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com