Google Charts: Pie Chart title position

后端 未结 3 1611
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 03:59

I was assigned to implement some Charts, and the bosses requested me to separate the title of the chart from the Chart, I tried to move the chart\'s area a little from the t

3条回答
  •  别那么骄傲
    2021-01-13 04:27

    I don't think you can do this through options in the vis api.

    However....

    The title is held in a text element that uses x/y positioning

    If you are using JQuery, this becomes a piece of cake

    $("text:contains(" + vencOptions.title + ")").attr({'x':'60', 'y':'20'})
    

    Adding that immediately after the .draw call and tweaking the x and y coords gives you pixel-perfect control.

    You can do it without JQuery, but time is pressing and I'll leave that to someone else :)

提交回复
热议问题