how to hide column in google charts table

前端 未结 5 652
梦如初夏
梦如初夏 2021-02-05 12:18

I\'ve got a Google Charts Table that displays a couple of columns and rows. Say for instance we have 4 columns(A,B,C,D respectively). How would I be able to still load column C\

5条回答
  •  [愿得一人]
    2021-02-05 12:55

    If you want to use particular column value in control wrapper but don't want to show that column in Google Charts then do following things.

    1) Add all column to your google charts data table.
    2) Add following things to options of your chartWrapper.

       // Set chart options
        optionsUser = {
            "series": {
                0: {
                    color: "white",
                    visibleInLegend: false
                }
            }
        };
    

    3) In above code series, 0 means the first line in your line chart. So It will set the color to white and also hide column name in Legends.

    4) This way is not the proper way to hide columns, Using DataView is recommended. Whenever you want to use data in the data table for adding controls to your chart but don't want to show that column in the chart this is the way.

提交回复
热议问题