Skip to content

Commit f71d905

Browse files
committed
Fix - VueUiXy - Allow incomplete highlightArea user configurations
1 parent 7d33eb6 commit f71d905

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/components/vue-ui-xy.vue

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,23 @@ function prepareConfig() {
287287
mergedConfig.events.datapointClick = null;
288288
}
289289
290+
// Merging highlight area(s) incomplete user configs
291+
if (props.config && hasDeepProperty(props.config, 'chart.highlightArea')) {
292+
if (Array.isArray(props.config.chart.highlightArea)) {
293+
mergedConfig.chart.highlightArea = props.config.chart.highlightArea
294+
.map(hl => mergeHighlightArea({
295+
defaultConfig: DEFAULT_CONFIG.chart.highlightArea,
296+
userConfig: hl
297+
}));
298+
} else {
299+
mergedConfig.chart.highlightArea = mergeHighlightArea({
300+
defaultConfig: DEFAULT_CONFIG.chart.highlightArea,
301+
userConfig: props.config.chart.highlightArea
302+
});
303+
}
304+
}
290305
// ----------------------------------------------------------------------------
291-
306+
292307
if (mergedConfig.theme) {
293308
return {
294309
...useNestedProp({
@@ -302,6 +317,13 @@ function prepareConfig() {
302317
}
303318
}
304319
320+
function mergeHighlightArea({ defaultConfig, userConfig }) {
321+
return useNestedProp({
322+
defaultConfig,
323+
userConfig
324+
});
325+
}
326+
305327
const isDataset = computed({
306328
get() {
307329
return !!props.dataset && props.dataset.length;

0 commit comments

Comments
 (0)