@datarailsshared/dr_renderer 1.4.42 → 1.4.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -141,9 +141,11 @@ function DrGaugeChart(pivotData, opts, isDynamicGoal) {
|
|
141
141
|
const goalValue = isGoal
|
142
142
|
? `<span style="font-size: 1.125em; color: ${options.gauge.colors.goal};">${formattedValue}</span>`
|
143
143
|
: `<span style="color: ${options.label.font_color};">${formattedValue}</span>`;
|
144
|
+
|
145
|
+
const goalTitleText = DrGaugeChart.getGoalTitleText(options);
|
144
146
|
const goalTitle =
|
145
|
-
isGoal && options.label.show_goal_name &&
|
146
|
-
? `<span style="font-size: 0.75em; color: ${options.gauge.colors.goal};">${
|
147
|
+
isGoal && options.label.show_goal_name && goalTitleText
|
148
|
+
? `<span style="font-size: 0.75em; color: ${options.gauge.colors.goal};">${goalTitleText}</span>`
|
147
149
|
: "";
|
148
150
|
const percentage = options.label.show_percentage_in_segments
|
149
151
|
? `<span style="font-size: 0.75em; color: ${options.gauge.colors.meta}; font-weight: 400;">(${this.toPercent(
|
@@ -376,7 +378,7 @@ function DrGaugeChart(pivotData, opts, isDynamicGoal) {
|
|
376
378
|
// goal tooltip if lebels are hidden
|
377
379
|
if (tick.pos === options.goal.value && !options.label.show) {
|
378
380
|
drTooltip.add(
|
379
|
-
`${options.label.show_goal_name ? options
|
381
|
+
`${options.label.show_goal_name ? DrGaugeChart.getGoalTitleText(options) || "" : ""
|
380
382
|
}<span style="font-weight: 600">${this.formatValue(options.goal.value)}</span>`,
|
381
383
|
chart.goalIcon.element,
|
382
384
|
{
|
@@ -470,7 +472,7 @@ function DrGaugeChart(pivotData, opts, isDynamicGoal) {
|
|
470
472
|
this.setGoal = function (pivotData, opts) {
|
471
473
|
if (isDynamicGoal) {
|
472
474
|
this.options.goal = {
|
473
|
-
title: this.options
|
475
|
+
title: DrGaugeChart.getGoalTitleText(this.options),
|
474
476
|
value: DrGaugeChart.getValue(pivotData, opts, true, true),
|
475
477
|
};
|
476
478
|
}
|
@@ -703,6 +705,12 @@ DrGaugeChart.getValue = function (pivotData, opts, isDynamicGoal = false, isForG
|
|
703
705
|
return aggregator.value();
|
704
706
|
};
|
705
707
|
|
708
|
+
DrGaugeChart.getGoalTitleText = function(options) {
|
709
|
+
return DrGaugeChart.dynamicGoalFeatureEnabled()
|
710
|
+
? _.get(options, 'label.goal_name') || options.goal.title
|
711
|
+
: options.goal.title;
|
712
|
+
}
|
713
|
+
|
706
714
|
DrGaugeChart.dynamicGoalFeatureEnabled = function() {
|
707
715
|
return DrGaugeChart.highchartsRenderer.hasFeature(helpers.FEATURES.ENABLE_GAUGE_DYNAMIC_GOAL);
|
708
716
|
}
|
@@ -6975,12 +6975,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
6975
6975
|
{
|
6976
6976
|
element_type: 'devider',
|
6977
6977
|
},
|
6978
|
-
{
|
6979
|
-
element_type: 'checkbox',
|
6980
|
-
element_label: 'Goal name',
|
6981
|
-
value_name: 'show_goal_name',
|
6982
|
-
default_value: true,
|
6983
|
-
},
|
6984
6978
|
{
|
6985
6979
|
element_type: 'checkbox',
|
6986
6980
|
element_label: 'Value % out of Goal',
|
@@ -6993,6 +6987,20 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
6993
6987
|
value_name: 'show_percentage_in_segments',
|
6994
6988
|
default_value: false,
|
6995
6989
|
},
|
6990
|
+
{
|
6991
|
+
element_type: 'checkbox',
|
6992
|
+
element_label: 'Show Goal label',
|
6993
|
+
value_name: 'show_goal_name',
|
6994
|
+
default_value: true,
|
6995
|
+
},
|
6996
|
+
{
|
6997
|
+
element_type: 'input',
|
6998
|
+
show_in_one_row: true,
|
6999
|
+
element_label: 'Goal name',
|
7000
|
+
value_name: 'goal_name',
|
7001
|
+
default_value: 'Goal',
|
7002
|
+
showFn: () => highchartsRenderer.hasFeature(FEATURES.ENABLE_GAUGE_DYNAMIC_GOAL),
|
7003
|
+
},
|
6996
7004
|
]
|
6997
7005
|
},
|
6998
7006
|
'label_with_percentage': {
|