gpt4 book ai didi

jquery - jquery highcharts 中的背景颜色变化

转载 作者:行者123 更新时间:2023-12-01 07:28:16 25 4
gpt4 key购买 nike

想知道如何改变jquery highcharts的背景颜色。我在 highcharts 网站( http://www.highcharts.com/demo/spline-irregular-time/gray )上尝试了代码,但无法让它工作。这是我的 highcharts 代码。任何帮助将不胜感激。谢谢。

<script type="text/javascript">
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'stats_vmonth',
type: 'spline'
},
title: {
text: 'Visitor Stats'
},
subtitle: {
text: 'This Month (<?php echo $thismonth;?>)'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%e. %b',
year: '%b'
}
},
yAxis: {
title: {
text: 'Visitors'
},
min: 0
},
tooltip: {
formatter: function() {
return '<b>'+ Highcharts.dateFormat('%e, %b', this.x) +'</b><br/>'+
this.y +' Visitors';
}
},
series: [{
name: 'This Year Visitor Stats',
// Define the data points. All series have a dummy year
// of 1970/71 in order to be compared on the same x axis. Note
// that in JavaScript, months start at 0 for January, 1 for February etc.
data: [
<?php while($morow = mysql_fetch_array($moresult)){?>
[Date.UTC(<?php echo $year;?>, <?php echo $month-1;?>, <?php echo $morow['day'];?>), <?php echo $morow['COUNT(url)'];?> ],
<?php }?>

]
}]
});


});
</script>

最佳答案

尝试主题选项

Highcharts.theme = {
chart: {
backgroundColor: {
linearGradient: [0, 0, 500, 500],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(240, 240, 255)']
]
}
}

关于jquery - jquery highcharts 中的背景颜色变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8182363/

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