Author |
Topic |
|
ajaypowral
USA
21 Posts |
Posted - 08 Aug 2016 : 17:48:35
|
Hi, I am using pushGetJSONOverallStatistics() method to get calculated value and show it in my custom labels in the html page. I noticed that the output of this method has a typo error - "StandardDevation" Here is the output it gives me for primary chart - "PrimaryChart": { "Mean": 26.817474351331633, "Minimum": 24.39048129150295, "Maximum": 29.171742505421896, "Range": 4.781261213918945, "StandardDevation": 1.1398256503923172, "Median": 26.68803790856918, "Variance": 1.299202513292269 }
I writing following code to show the values in my custom label - $("#__qcspc_sd_value")[0].innerHTML = jsonobj.SPCOverallStatistics.PrimaryChart.StandardDevation;
Now, my concern is if you correct this typo in future release, my code will break and will no longer work. Do you have any suggestions for this.
Ajay |
|
quinncurtis
1586 Posts |
Posted - 09 Aug 2016 : 09:48:58
|
Thanks for pointing this out. We will correct the spelling it in the underlying library, which we will update next week. If you are concerned about it, you can add a simple test to see which property name is present. This seems to be common among javascript programmers.
if (typeof StandardDevation !== 'undefined') { $("#__qcspc_sd_value")[0].innerHTML = jsonobj.SPCOverallStatistics.PrimaryChart.StandardDevation; } else if (typeof StandardDeviation !== 'undefined') { $("#__qcspc_sd_value")[0].innerHTML = jsonobj.SPCOverallStatistics.PrimaryChart.StandardDeviation; }
|
|
|
|
Topic |
|
|
|