首页 文章

在谷歌图表中预选点

提问于
浏览
1

目前我正在使用谷歌图表,我有一个快速的问题 . 是否可以渲染具有预先选定的某个点的图形,而不必点击某个点以使其“脱颖而出” .

因此,例如在渲染时波纹管自动可见 .

enter image description here

https://developers.google.com/chart/interactive/docs/gallery/linechart

2 回答

  • -1

    使用Chart's setSelection() method预先选择一个点 .

  • 0

    将默认值放在此函数的数组中,并将预先选中 .

    function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004',  1000,      400],
          ['2005',  1170,      460],
          ['2006',  660,       1120],
          ['2007',  1030,      540]
        ]);
    

相关问题