@@ -755,9 +755,10 @@ export class PolarArc {
755755 * @param {number } top - The top position of the tooltip.
756756 * @param {number } left - The left position of the tooltip.
757757 * @param {string } fontSize - The font size of the tooltip text.
758+ * @param {Chart } chartId - Chart element id.
758759 * @returns {void }
759760 */
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 {
761762 let tooltip : HTMLElement = getElement ( id ) as HTMLElement ;
762763 const style : string = 'top:' + top . toString ( ) + 'px;' +
763764 'left:' + left . toString ( ) + 'px;' +
@@ -768,7 +769,7 @@ export function createTooltip(id: string, text: string, top: number, left: numbe
768769 tooltip = createElement ( 'div' , {
769770 id : id , innerHTML : ' ' + text + ' ' , styles : style
770771 } ) ;
771- document . body . appendChild ( tooltip ) ;
772+ getElement ( chartId ) . appendChild ( tooltip ) ;
772773 } else {
773774 tooltip . setAttribute ( 'innerHTML' , ' ' + text + ' ' ) ;
774775 ( tooltip as HTMLElement ) . style . cssText = style ;
@@ -1065,7 +1066,15 @@ export function getMinPointsDelta(axis: Axis | Chart3DAxis, seriesCollection: Se
10651066 let xValues : Object [ ] ;
10661067 let minVal : number ;
10671068 let seriesMin : number ;
1069+ let allSeriesXvalueLen : boolean = true ;
10681070 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+ }
10691078 for ( let index : number = 0 ; index < seriesCollection . length ; index ++ ) {
10701079 const series : Series = seriesCollection [ index as number ] ;
10711080 xValues = [ ] ;
@@ -1079,7 +1088,7 @@ export function getMinPointsDelta(axis: Axis | Chart3DAxis, seriesCollection: Se
10791088 return point . xValue ;
10801089 } ) ;
10811090 xValues . sort ( ( first : Object , second : Object ) => { return < number > first - < number > second ; } ) ;
1082- if ( xValues . length === 1 ) {
1091+ if ( xValues . length === 1 && allSeriesXvalueLen ) {
10831092 if ( axis . valueType === 'Category' ) {
10841093 const minValue : number = series . xAxis . visibleRange . min ;
10851094 const delta : number = < number > xValues [ 0 ] - minValue ;
0 commit comments