mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* allows to hide warnings in gauge * should default to true if option is not set * fixing based on review * default for isDisplayWarning needs to be applied, else it fails
This commit is contained in:
parent
af6a2fc6e2
commit
aacd23403a
5 changed files with 17 additions and 3 deletions
|
@ -35,6 +35,17 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="kuiSideBarFormRow">
|
||||
<label class="kuiSideBarFormRow__label" for="displayWarnings">
|
||||
Display warnings
|
||||
<kbn-info info="Turns on/off warnings. When turned on, a warning will be shown if not all labels could be displayed."></kbn-info>
|
||||
</label>
|
||||
|
||||
<div class="kuiSideBarFormRow__control">
|
||||
<input class="kuiCheckBox" id="displayWarnings" type="checkbox" ng-model="vis.params.isDisplayWarning">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="kuiSideBarFormRow">
|
||||
<label class="kuiSideBarFormRow__label" for="addLegend">
|
||||
Show Legend
|
||||
|
|
|
@ -21,7 +21,7 @@ export default function GaugeVisType(Private) {
|
|||
type: 'gauge',
|
||||
addTooltip: true,
|
||||
addLegend: true,
|
||||
|
||||
isDisplayWarning: false,
|
||||
gauge: {
|
||||
verticalSplit: false,
|
||||
extendRange: true,
|
||||
|
|
|
@ -19,6 +19,7 @@ export default function GoalVisType(Private) {
|
|||
defaults: {
|
||||
addTooltip: true,
|
||||
addLegend: false,
|
||||
isDisplayWarning: false,
|
||||
type: 'gauge',
|
||||
gauge: {
|
||||
verticalSplit: false,
|
||||
|
|
|
@ -150,6 +150,7 @@ export function MeterGaugeProvider() {
|
|||
const marginFactor = 0.95;
|
||||
const tooltip = this.gaugeChart.tooltip;
|
||||
const isTooltip = this.gaugeChart.handler.visConfig.get('addTooltip');
|
||||
const isDisplayWarning = this.gaugeChart.handler.visConfig.get('isDisplayWarning', false);
|
||||
const maxAngle = this.gaugeConfig.maxAngle;
|
||||
const minAngle = this.gaugeConfig.minAngle;
|
||||
const angleFactor = this.gaugeConfig.gaugeType === 'Arc' ? 0.75 : 1;
|
||||
|
@ -290,7 +291,7 @@ export function MeterGaugeProvider() {
|
|||
});
|
||||
}
|
||||
|
||||
if (hiddenLabels) {
|
||||
if (hiddenLabels && isDisplayWarning) {
|
||||
this.gaugeChart.handler.alerts.show('Some labels were hidden due to size constraints');
|
||||
}
|
||||
|
||||
|
|
|
@ -134,6 +134,7 @@ export function SimpleGaugeProvider() {
|
|||
drawGauge(svg, data, width) {
|
||||
const tooltip = this.gaugeChart.tooltip;
|
||||
const isTooltip = this.gaugeChart.handler.visConfig.get('addTooltip');
|
||||
const isDisplayWarning = this.gaugeChart.handler.visConfig.get('isDisplayWarning', false);
|
||||
const fontSize = this.gaugeChart.handler.visConfig.get('gauge.style.fontSize');
|
||||
|
||||
const labelColor = this.gaugeConfig.style.labelColor;
|
||||
|
@ -237,7 +238,7 @@ export function SimpleGaugeProvider() {
|
|||
});
|
||||
}
|
||||
|
||||
if (hiddenLabels) {
|
||||
if (hiddenLabels && isDisplayWarning) {
|
||||
this.gaugeChart.handler.alerts.show('Some labels were hidden due to size constraints');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue