gpt4 book ai didi

javascript - 如何自定义 Flotr2 雷达图

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

http://www.humblesoftware.com/flotr2

我正在尝试修改 Flotr2 雷达图的默认字体大小、粗细和颜色。我可以在 flotr2.js 文件中更改它,但我想单独保留源文件。

目前,当我在 Flotr.draw 调用中设置更大的 fontSize 时,它​​只会进一步分隔标签。

function drawGraph(container, series, ticks)
{
Flotr.draw(container, series, {
colors: colors,
HtmlText: true,
fontSize: 30,
radar: {
show: true
},
grid: {
circular: true,
minorHorizontalLines: true
},
yaxis: {
min: 0,
max: 7,
minorTickFreq: 1,
showLabels: false
},
xaxis: {
ticks: ticks,
titleAlign: 'right'
},
legend: {
position: 'ss',
container: document.getElementById("legendItems")
}
});
}

我不确定还能尝试什么......

最佳答案

在绘制图形之前从窗口对象访问变量似乎效果很好。

window.Flotr.defaultOptions.fontSize = 8;
window.Flotr.defaultOptions.xaxis.color = '#000000';

找不到更改字体粗细的方法。

关于javascript - 如何自定义 Flotr2 雷达图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53210624/

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