Only one series is displaying data

  • 1
  • Problem
  • Updated 3 years ago
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Pat,

I think you may have a scale issue. The Values axis for your Inventory series shows 0-5, but for Production, it shows 0-125. Try adding a second data axis and assigning one of the series to it.
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Wait, I think I see it. You do need to remove that Max Value property, but I think you also need to change the Split. Both series are getting split by the same values, so the last one in is writing over the first one. Try using Template mode for both series and enter whatever text you want to show up (say Inventory and Production).
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Split values was the issue. Really shouldn't be though. I should be able to use the same field on each series and not affect the other.

A new issue now though. The categories names are doubled.

Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Well, I think you would end up with something like the screenshot that you just posted: each series split into two. Splits take a single series and "split" it into one or more series based on whatever data you've got at runtime. If you want to evaluate each series you create individually, you'll split each one individually too. I think what you actually want is to split on Record Type Name but conditionally select your Data Field based on record type. You could do this with a UI-Only Formula field like...
<field id="EffectiveAmount__ui" uionly="true" displaytype="FORMULA" precision="9" scale="2" label="Effective Amount" defaultValue="0" readonly="true" returntype="DOUBLE">
<formula>IF({{recordTypeName}}=="Inventory",{{sumInventoryQuantityc}},{{sumProductQuantityUsedc}})</formula>
</field>
Add this field to your aggregate model (note: the formula may need to be adjusted, of course), and use it as the Data Field for your one and only Chart series, splitting on Record Type Name. However, you'll still have the problem with scale where one series would dwarf the other. You would have to write some JavaScript to assign one of the two series to the second axis. The code free solution is to use two models, one for each Record Type. Either one can be the chart's model, then the other will be the model for your second series. Make sense?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
No dice. Series didn't the UI-Only field.

Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Highcharts error #14 means that it's trying to plot a string value to a data axis (which requires a number). Check the model data for that formula field. If it's not showing numbers, something is wrong with the formula (or with my assessment of the data model, always a possibity). I tested it with the Opportunity object in our Dev Org and principle, this approach does work. Also, it looks like scaling may not be a problem after all.