uses maximum space for arc gauge and center aligns it (#15140) (#15235)

This commit is contained in:
Peter Pisljar 2017-11-29 16:03:39 +01:00 committed by GitHub
parent ee26f2a728
commit 7848c07a29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -69,7 +69,7 @@ export function GaugeChartProvider(Private) {
} else {
svg.attr('height', height);
const transformX = width / 2;
const transformY = height / 2;
const transformY = self.gaugeConfig.gaugeType === 'Arc' ? height / (2 * 0.75) : height / 2;
g.attr('transform', `translate(${transformX}, ${transformY})`);
}

View file

@ -152,7 +152,7 @@ export function MeterGaugeProvider() {
const isTooltip = this.gaugeChart.handler.visConfig.get('addTooltip');
const maxAngle = this.gaugeConfig.maxAngle;
const minAngle = this.gaugeConfig.minAngle;
const angleFactor = this.gaugeConfig.gaugeType === 'Meter' ? 0.75 : 1;
const angleFactor = this.gaugeConfig.gaugeType === 'Arc' ? 0.75 : 1;
const maxRadius = (Math.min(width, height / angleFactor) / 2) * marginFactor;
const extendRange = this.gaugeConfig.extendRange;