Skip to content

Commit

Permalink
🐛 Handle case of undefined fitting for line/area (#126891)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
dej611 and kibanamachine authored Mar 7, 2022
1 parent bc0d9e7 commit f12891e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/vis_types/xy/public/config/get_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { ScaleContinuousType } from '@elastic/charts';
import { Fit, ScaleContinuousType } from '@elastic/charts';

import { Datatable } from '../../../../expressions/public';
import { BUCKET_TYPES } from '../../../../data/public';
Expand Down Expand Up @@ -92,7 +92,7 @@ export function getConfig(
return {
// NOTE: downscale ratio to match current vislib implementation
markSizeRatio: radiusRatio * 0.6,
fittingFunction,
fittingFunction: fittingFunction ?? Fit.Linear,
fillOpacity,
detailedTooltip,
orderBucketsBySum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function ElasticChartsOptions(props: ValidationVisOptionsProps<VisParams>
})}
options={fittingFunctions}
paramName="fittingFunction"
value={stateParams.fittingFunction}
value={stateParams.fittingFunction ?? fittingFunctions[2].value}
setValue={(paramName, value) => {
if (trackUiMetric) {
trackUiMetric(METRIC_TYPE.CLICK, 'fitting_function_selected');
Expand Down

0 comments on commit f12891e

Please sign in to comment.