如何更改Britecharts中的图表字体大小反应?
我无法使用Britecharts更改X和Y轴的字体大小。 (请参阅 https://britecharts.githarts.githarb.io/britecharts-ritecharts-reacts-react/ >)。从文档看来,该方法是“标签尺寸”,但这目前尚不正常。一个分叉的Codepen显示问题: https://codepen.io of a>。谢谢。
const {Bar} = window['britecharts-react'];
const barData = [
{
name: 'Radiating',
value: 2,
},
{
name: 'Opalescent',
value: 4,
},
{
name: 'Shining',
value: 3,
},
{
name: 'Vibrant',
value: 6,
},
{
name: 'Vivid',
value: 6,
},
{
name: 'Brilliant',
value: 1,
},
];
const marginObject = {
left: 100,
right: 40,
top: 40,
bottom: 40,
};
ReactDOM.render(
<Bar
data={barData}
width={400}
isHorizontal={true}
margin={marginObject}
labelsSize={50}
/>,
document.getElementById('app')
);
I am unable to change the font-size of the x and y-axis using Britecharts - React. (see https://britecharts.github.io/britecharts-react/#bar). From the docs it seems that the method is "labelsSize" but this is not currently working. A forked codepen showing the issue is here: https://codepen.io/mvolny/pen/XWZrmXR. Thanks.
const {Bar} = window['britecharts-react'];
const barData = [
{
name: 'Radiating',
value: 2,
},
{
name: 'Opalescent',
value: 4,
},
{
name: 'Shining',
value: 3,
},
{
name: 'Vibrant',
value: 6,
},
{
name: 'Vivid',
value: 6,
},
{
name: 'Brilliant',
value: 1,
},
];
const marginObject = {
left: 100,
right: 40,
top: 40,
bottom: 40,
};
ReactDOM.render(
<Bar
data={barData}
width={400}
isHorizontal={true}
margin={marginObject}
labelsSize={50}
/>,
document.getElementById('app')
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Brightcharts-Reacter GitHub页面中发现了这一点。基本上,您需要通过CSS来定位图表的元素。请参阅更改字体大小的示例:
类似地,
Found this out asking around in the Brightcharts-React github page. Basically, you need to target the elements of the chart via css. See example for changing the font-size:
similarly,