Solved

Pie Chart to show both Dollars and Percentage

  • 8 January 2021
  • 2 replies
  • 129 views

Hi Looker Experts,

I wanted to show both the Dollars and Percentage in a single Pie Chart, like this below. Will there be any solution/suggestion on how to achieve this? 

If not, is there any option to have a Toggle selector to change from Dollars to percentage and vice-versa? 

 

icon

Best answer by DickyMohanty 12 January 2021, 13:36

Hi Team,

I was able to achieve this using the ‘html’ concept in one of the measure as shown below: 

Even though its not showing up the % on top of the Pies/Sections, but at least it shows around the Chart. 

Still I would look for any solutions to show on top of the Pies.

measure: Total_Purchases_Hidden {
  label: "Total Sales Hidden"
  type: sum
  hidden: yes
  value_format: "$#,##0;($#,##0)"
  sql: ${ext_sell_dlr} ;;
  }

  measure: Total_Purchases {
    label: "Total Sales"
    type: sum
    sql: ${ext_sell_dlr} ;;
    html:
       <b>{{ Total_Purchases_Hidden._rendered_value }} </b> <br>  <b> {{ Total_Purchases_Percent._rendered_value }}  </b> </div>
      ;;
  }

 

Regards!

 

View original

2 replies

Hello Team,

 

Any possible suggestion here?

Regards!

Hi Team,

I was able to achieve this using the ‘html’ concept in one of the measure as shown below: 

Even though its not showing up the % on top of the Pies/Sections, but at least it shows around the Chart. 

Still I would look for any solutions to show on top of the Pies.

measure: Total_Purchases_Hidden {
  label: "Total Sales Hidden"
  type: sum
  hidden: yes
  value_format: "$#,##0;($#,##0)"
  sql: ${ext_sell_dlr} ;;
  }

  measure: Total_Purchases {
    label: "Total Sales"
    type: sum
    sql: ${ext_sell_dlr} ;;
    html:
       <b>{{ Total_Purchases_Hidden._rendered_value }} </b> <br>  <b> {{ Total_Purchases_Percent._rendered_value }}  </b> </div>
      ;;
  }

 

Regards!

 

Reply