A
A
Aleksandr2016-03-15 10:53:49
JavaScript
Aleksandr, 2016-03-15 10:53:49

Object doesn't support property or method?

made a graph, locally everything works fine.
but when integrating into 1C, an error occurs.
4fa2688b300e4d7ebf1f348624f19618.png

for(var pointId in this.points){
                        var point = this.points[pointId],
                            sum = 0;

                        if(sourceDataMoney.hasOwnProperty(point.series.name) && sourceDataMoney[point.series.name].hasOwnProperty(point.x)){
                            sum = sourceDataMoney[point.series.name][point.x][2].formatMoney(0, '.', '') + ' руб.';
                        }
                        html += '<span style="color:' + point.color + '">' + point.series.name + ' : ' + point.y + ' заказов на  ' + sum + '</span><br />';
                        totalCount += point.y
                        var totalSumArr = sum.split(' ,');
                        for(var i=0;i<totalSumArr.length;i++){
                totalSum = totalSum + parseInt(totalSumArr[i]);
            }
                    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
X-, 2016-03-15
@Sashjkeee

and if so?
var totalSumArr = sum.split(' ,');
replace with
var totalSumArr = (sum===0?[]:sum.split(' ,'));

S
sergealmazov, 2016-03-15
@sergealmazov

We write:
console.log(sum);
We look. We think a lot.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question