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

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

View file

@ -71,7 +71,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;