gpt4 book ai didi

html - jqplot图形文字颜色

转载 作者:太空宇宙 更新时间:2023-11-03 23:33:41 25 4
gpt4 key购买 nike

我正在使用 jqplot,我正在努力实现一些目标

  1. 我正在尝试更改沿 x 轴和 y 轴显示的文本颜色。
  2. 我正在尝试删除图形边框(仅限上边框和右边框)

这是我的图表的样子

enter image description here

在 x 轴上你会注意到数字 30 - 90 我需要它是白色的,在 y 轴上你会注意到日期,我也需要它是白色的

这就是我的 JS 的样子

var line2 = [
['1/1/2008', 42],
['2/14/2008', 56],
['3/7/2008', 39],
['4/22/2008', 81]
];

var plot2 = $.jqplot('progress_chart', [line2], {
seriesColors: [ "#F2A809"],

series:[
{
// Change our line width and use a diamond shaped marker.
lineWidth:5,
markerOptions: { style:'circle' }
}
],
grid:{
background: 'transparent', // CSS color spec for background color of grid.
borderColor: '#ffffff', // CSS color spec for border around grid.
borderWidth: 2.0 // pixel width of border around grid.
},

axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
shadowAlpha : '0.1',
tickOptions: {
// labelPosition: 'middle',
angle: 15,
showGridline: false,
color: '#ffffff'
}
},
yaxis: {
label: '',
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
tickOptions: {
showGridline: false
}
}
}
});

我将非常感谢这里的任何帮助。

更新

感谢@redditor 的回答,我让它工作了,但这导致所有图形 x 和 y 轴文本都变成白色。这个特定的图表位于另一个名为 tab-inner-content 的 div 中,所以我使用以下 CSS 让它工作。

.tab-inner-content .jqplot-target {
color:#ffffff !important;
}

最佳答案

替换

tickOptions: {
// labelPosition: 'middle',
angle: 15,
showGridline: false,
color: '#ffffff'
}

通过

tickOptions: {
// labelPosition: 'middle',
angle: 15,
showGridline: false,
textColor: '#ffffff'
}

关于html - jqplot图形文字颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24653627/

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