Skip to content

Commit

Permalink
[MIM-1973] added custom responsive config to barNegativeConfig (#2796)
Browse files Browse the repository at this point in the history
added custom responsive config to barNegativeConfig
  • Loading branch information
annesiri authored Jun 13, 2024
1 parent 311764e commit b726f09
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/lib/ssb/parts/highcharts/graph/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export const createDefaultConfig = (highchartData, displayName, language) => ({
},
},
yAxis: [
// overrides left y axis
// left y axis
{
labels: {
align: 'right',
Expand All @@ -329,7 +329,7 @@ export const createDefaultConfig = (highchartData, displayName, language) => ({
text: isEnabled('highcharts-y-axix-title-mobile', true, 'ssb') ? highchartData.yAxisTitle : '',
},
},
// overrides right y axis
// right y axis
{
labels: {
align: 'left',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ export function barNegativeConfig(highchartContent, options) {
description: options.xAxisLabel ? options.xAxisLabel : undefined,
},
},
responsive: {
rules: [
{
chartOptions: {
chart: {
height: '120%',
},
// NOTE: on negative bar chart, xAxis is vertical and yAxis is horizontal, don't ask why.
yAxis: {
labels: {
y: 20,
},
},
xAxis: {
labels: {
y: 7,
},
},
},
condition: {
maxWidth: 450,
},
},
],
},
}
return mergeDeepRight(defaultConfig, customConfig)
}

0 comments on commit b726f09

Please sign in to comment.