简体   繁体   English

如何增加 Google 时间线图表的行高?

[英]How do I increase the row height of Google Timelines Chart?

在此处输入图片说明

I've been working with Google Timeline Charts for a project.我一直在使用 Google Timeline Charts 进行一个项目。 As you can see the full text of the event is not displayed.如您所见,未显示事件的全文。 How do I increase the height of rows so that it displays the full text instead?如何增加行高以显示全文?

Was looking for the same thing.正在寻找同样的东西。 Found a workaround... Changing the bar label's font size can be used to change the height of the bar itself.找到了解决方法... 更改条形标签的字体大小可用于更改条形本身的高度。 It's crude, but it works!这很粗糙,但它有效!

timeline: {
    barLabelStyle: {
        fontSize: 50
    }
}

Credit goes to https://groups.google.com/forum/m/#!topic/google-visualization-api/IKm5IlMx9es归功于https://groups.google.com/forum/m/#!topic/google-visualization-api/IKm5IlMx9es

You can zoom your chart by setting greater value of width您可以通过设置更大的宽度值来缩放图表

var options = {
    width : 2000,
    ...
};

About CSS (comments).关于 CSS(评论)。 After chart.draw() there is SVG object contains chart.在 chart.draw() 之后有一个包含图表的 SVG 对象。 You can select elements like svg > g:nth-child(5) > rect and change properties.您可以选择svg > g:nth-child(5) > rect等元素并更改属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM