This is a migrated thread and some comments may be shown as answers.

Uncaught TypeError: Cannot read property 'toRect' of undefined

1 Answer 542 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Octavio
Top achievements
Rank 1
Octavio asked on 04 Jun 2018, 11:43 AM

Hi everyone,

 

I'm using a stacked bar chart and is not rendering correctly, there're missing bars (attachment 1)

 

2 Questions:

 

1.- When I set tool tip shared to true, the next error is shown in console:

Uncaught TypeError: Cannot read property 'toRect' of undefined
    at init.createHighlight (kendo.all.js:156672)
    at init.toggleHighlight (kendo.all.js:146628)
    at init.togglePointHighlight (kendo.all.js:161066)
    at init.show (kendo.all.js:161043)
    at init._trackSharedTooltip (kendo.all.js:165450)
    at init._mousemove (kendo.all.js:165416)
    at o (kendo.all.js:3210)

2.- My code is the next, why does the bars are not rendering correctly?:

$("#chart").kendoChart({
                        title: {
                            text: "Tests"
                        },
                        legend: {
                            position: "bottom"
                        },
                        series: [data.series.ABC, data.series.Serie1, data.series.Serie2, data.series.Serie3],
                        valueAxis: [{
                            name: "abc",
                            title: {
                                text: "ABC"
                            },
                            min: 0,
                            max: 100,
                        }, {
                            name: "units",
                            type: "log",
                            title: {
                                text: "Units"
                            }
                        }],
                        categoryAxis: {
                            categories: data.categories,
                            axisCrossingValue: [0, data.categories.length + 1],
                            labels: {
                                visible: true,
                                rotation: 90
                            },
                            crosshair: {
                                visible: true
                            }
                        },
                        tooltip: {
                            visible: true,
                            shared: true
                        }
                    });

 

The length of the series is the same, and the series are the next (json formatted):

ABC:
color:"#555"
data:(49) [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 99, 99, 98, 98, 98, 98, 97, 97, 97, 96, 95, 93, 92, 91, 89, 88, 88, 88, 85, 84, 83, 82, 80, 80, 79, 78, 76, 66, 55, 50, 8, 0, 0, 0, 0, 0]
name:"ABC"
tooltip:{visible: true, template: "#= value #"}
type:"line"

Serie1:
axis:"units"
color:"#ffacaa"
data:(49) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 11, 1, 3, 5, 2, 7, 3, 3, 3, 6, 19, 8, 13, 29, 2, 6, 8, 13, 4, 4, 1, 15, 3, 18, 2, 31, 3, 22, 1, 2, 7, 4, 1]
name:"Serie1"
stack:true
tooltip:{visible: true, template: "#= value #"}
type:"bar"

Serie2:
axis:"units"
color:"#aaffb3"
data:(49) [20, 20, 185, 38, 4, 40, 21, 66, 73, 107, 3, 15, 14, 216, 149, 71, 778, 66, 182, 240, 80, 242, 81, 70, 44, 79, 194, 71, 103, 220, 15, 34, 45, 67, 19, 16, 4, 58, 11, 60, 4, 39, 3, 2, 0, 0, 0, 0, 0]
name:"Serie2"
stack:true
tooltip:{visible: true, template: "#= value #"}
type:"bar"

Serie3:
axis:"units"
color:"#4286f4"
data:(49) [20, 20, 185, 38, 4, 40, 21, 66, 73, 107, 3, 15, 14, 217, 150, 72, 789, 67, 185, 245, 82, 249, 84, 73, 47, 85, 213, 79, 116, 249, 17, 40, 53, 80, 23, 20, 5, 73, 14, 78, 6, 70, 6, 24, 1, 2, 7, 4, 1]
name:"Serie3"
stack:true
tooltip:{visible: true, template: "#= value #"}
type:"bar"

 

 

1 Answer, 1 is accepted

Sort by
0
Octavio
Top achievements
Rank 1
answered on 04 Jun 2018, 12:59 PM

Problem solved for the issues,

log(0) is undefined

 

 

Tags
Charts
Asked by
Octavio
Top achievements
Rank 1
Answers by
Octavio
Top achievements
Rank 1
Share this question
or