Merge pull request #6672 from kalutkaz/fix/pieFlotWidget
[3.4] UI: Fix visual bugs in pie flot widget
This commit is contained in:
		
						commit
						9afdd97363
					
				@ -312,6 +312,9 @@ export class TbFlot {
 | 
			
		||||
      if (this.settings.stroke) {
 | 
			
		||||
        this.options.series.pie.stroke.color = this.settings.stroke.color || '#fff';
 | 
			
		||||
        this.options.series.pie.stroke.width = this.settings.stroke.width || 0;
 | 
			
		||||
        if (this.options.series.pie.stroke.width) {
 | 
			
		||||
          this.scalingPieRadius();
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (this.options.series.pie.label.show) {
 | 
			
		||||
@ -690,12 +693,23 @@ export class TbFlot {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private scalingPieRadius() {
 | 
			
		||||
      let scalingLine;
 | 
			
		||||
      this.ctx.width > this.ctx.height ? scalingLine = this.ctx.height : scalingLine = this.ctx.width;
 | 
			
		||||
      let changeRadius = this.options.series.pie.stroke.width / scalingLine;
 | 
			
		||||
      this.options.series.pie.radius = changeRadius < 1 ? this.settings.radius - changeRadius : 0;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public resize() {
 | 
			
		||||
    if (this.resizeTimeoutHandle) {
 | 
			
		||||
      clearTimeout(this.resizeTimeoutHandle);
 | 
			
		||||
      this.resizeTimeoutHandle = null;
 | 
			
		||||
    }
 | 
			
		||||
    if (this.plot && this.plotInited) {
 | 
			
		||||
      if (this.chartType === 'pie' && this.settings.stroke?.width) {
 | 
			
		||||
          this.scalingPieRadius();
 | 
			
		||||
          this.redrawPlot();
 | 
			
		||||
      } else {
 | 
			
		||||
        const width = this.$element.width();
 | 
			
		||||
        const height = this.$element.height();
 | 
			
		||||
        if (width && height) {
 | 
			
		||||
@ -709,6 +723,7 @@ export class TbFlot {
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public checkMouseEvents() {
 | 
			
		||||
    const enabled = !this.ctx.isEdit;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user