Chart to show what percentage X field represent from Y field

  • 1
  • Question
  • Updated 3 years ago
  • Answered

Hi guys i'm very new to skuid and this community ,hopefully someone can help me :)

This may be simple , but cannot figure it out for the life of me....

I have 2 number fields for the same record

X (represents the grand total) 
Y (represent another number)

I want to be able to show on aDonut or Stacked column the % Y represent compared to X

Example

X = 1000
Y = 300
The Donut chart would show both Slices and the Big percentage in the middle would show 30%

Or a stacked bar, where Y would show in a different color (30% of the column would be blue fopr example, and the other 70 would be red...)

I hope it make sense

Thank you in advance!

 

Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Check out this topic on adding additional series to your charts. https://community.skuidify.com/skuid/topics/display-chart-series-diff

You don't yet have the comparison as data in your chart, so you need to run a before render snippet to do that comparison and create a new series. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Another idea.  (These things usually come to me as I'm going to sleep...)  Make the percentage data part of your model using formula fields in salesforce or UI only fields in your model.  Then you'll have the data together and can simply build different series on your charts to show the stack. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
This is the way to go! Much more flexible than a before render snippet, because the before render snippet doesn't run again when model data changes (unless that changed in Banzai?), but your ui-only formula fields do update with model changes.
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Great, ty very much guys, i'm trying to get those charts going , and so far so good :)

Now trying the drilldown part , which seems like a lot of fun :D

Thank you for all your help