@@ -755,9 +755,10 @@ export class PolarArc {
755
755
* @param {number } top - The top position of the tooltip.
756
756
* @param {number } left - The left position of the tooltip.
757
757
* @param {string } fontSize - The font size of the tooltip text.
758
+ * @param {Chart } chartId - Chart element id.
758
759
* @returns {void }
759
760
*/
760
- export function createTooltip ( id : string , text : string , top : number , left : number , fontSize : string ) : void {
761
+ export function createTooltip ( id : string , text : string , top : number , left : number , fontSize : string , chartId : string ) : void {
761
762
let tooltip : HTMLElement = getElement ( id ) as HTMLElement ;
762
763
const style : string = 'top:' + top . toString ( ) + 'px;' +
763
764
'left:' + left . toString ( ) + 'px;' +
@@ -768,7 +769,7 @@ export function createTooltip(id: string, text: string, top: number, left: numbe
768
769
tooltip = createElement ( 'div' , {
769
770
id : id , innerHTML : ' ' + text + ' ' , styles : style
770
771
} ) ;
771
- document . body . appendChild ( tooltip ) ;
772
+ getElement ( chartId ) . appendChild ( tooltip ) ;
772
773
} else {
773
774
tooltip . setAttribute ( 'innerHTML' , ' ' + text + ' ' ) ;
774
775
( tooltip as HTMLElement ) . style . cssText = style ;
@@ -1065,7 +1066,15 @@ export function getMinPointsDelta(axis: Axis | Chart3DAxis, seriesCollection: Se
1065
1066
let xValues : Object [ ] ;
1066
1067
let minVal : number ;
1067
1068
let seriesMin : number ;
1069
+ let allSeriesXvalueLen : boolean = true ;
1068
1070
const stackingGroups : string [ ] = [ ] ;
1071
+ for ( const series of seriesCollection ) {
1072
+ const xValues : Object [ ] = series . points . map ( ( point : Points ) => point . xValue ) ;
1073
+ if ( xValues . length !== 1 ) {
1074
+ allSeriesXvalueLen = false ;
1075
+ break ; // No need to continue if one series fails the condition
1076
+ }
1077
+ }
1069
1078
for ( let index : number = 0 ; index < seriesCollection . length ; index ++ ) {
1070
1079
const series : Series = seriesCollection [ index as number ] ;
1071
1080
xValues = [ ] ;
@@ -1079,7 +1088,7 @@ export function getMinPointsDelta(axis: Axis | Chart3DAxis, seriesCollection: Se
1079
1088
return point . xValue ;
1080
1089
} ) ;
1081
1090
xValues . sort ( ( first : Object , second : Object ) => { return < number > first - < number > second ; } ) ;
1082
- if ( xValues . length === 1 ) {
1091
+ if ( xValues . length === 1 && allSeriesXvalueLen ) {
1083
1092
if ( axis . valueType === 'Category' ) {
1084
1093
const minValue : number = series . xAxis . visibleRange . min ;
1085
1094
const delta : number = < number > xValues [ 0 ] - minValue ;
0 commit comments