axidio-styleguide-library1-v2 0.2.7 → 0.2.8
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.
|
@@ -3035,213 +3035,320 @@ class GuageChartComponent extends ComponentUniqueId {
|
|
|
3035
3035
|
};
|
|
3036
3036
|
}
|
|
3037
3037
|
get isAlertEnabled() {
|
|
3038
|
-
return this.chartConfiguration?.headerMenuOptions?.some(
|
|
3038
|
+
return this.chartConfiguration?.headerMenuOptions?.some(option => option.id === 'editAlert');
|
|
3039
3039
|
}
|
|
3040
|
-
ngOnInit() { }
|
|
3041
3040
|
ngOnChanges() {
|
|
3042
|
-
this
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
this.redrawChart();
|
|
3041
|
+
let self = this;
|
|
3042
|
+
d3.select('#' + self.uniqueId).remove();
|
|
3043
|
+
this.initializeLineChart();
|
|
3046
3044
|
}
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
redrawChart() {
|
|
3051
|
-
d3.select('#' + this.uniqueId).remove();
|
|
3045
|
+
onResized(event) {
|
|
3046
|
+
let self = this;
|
|
3047
|
+
d3.select('#' + self.uniqueId).remove();
|
|
3052
3048
|
this.initializeLineChart();
|
|
3053
3049
|
}
|
|
3054
|
-
|
|
3055
|
-
* Main entry point for chart rendering
|
|
3056
|
-
*/
|
|
3050
|
+
ngOnInit() { }
|
|
3057
3051
|
initializeLineChart() {
|
|
3058
|
-
this
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3052
|
+
var self = this;
|
|
3053
|
+
let data = [];
|
|
3054
|
+
let metaData = null;
|
|
3055
|
+
let colorMaps = [];
|
|
3056
|
+
let angleValue = [];
|
|
3057
|
+
let data_ready = [];
|
|
3058
|
+
let labelArray = [];
|
|
3059
|
+
let colorType = null;
|
|
3060
|
+
let isria = this.customChartConfiguration.isRia;
|
|
3061
|
+
for (var i in this.defaultConfiguration) {
|
|
3062
|
+
this.chartConfiguration[i] = ChartHelper.getValueByConfigurationType(i, this.defaultConfiguration, this.customChartConfiguration);
|
|
3063
|
+
}
|
|
3064
|
+
data = this.chartData.data;
|
|
3065
|
+
metaData = this.chartData.metaData;
|
|
3066
|
+
colorType = metaData.colorType;
|
|
3067
|
+
if (colorType == 'low') {
|
|
3068
|
+
colorMaps = this.chartConfiguration.low_colorMap;
|
|
3069
|
+
}
|
|
3070
|
+
else {
|
|
3071
|
+
colorMaps = this.chartConfiguration.high_colorMap;
|
|
3072
3072
|
}
|
|
3073
|
-
if (this.chartConfiguration.isHeaderVisible !== undefined)
|
|
3074
|
-
this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
3075
|
-
}
|
|
3076
|
-
/**
|
|
3077
|
-
* Process data, calculate colors and angles
|
|
3078
|
-
*/
|
|
3079
|
-
processChartData() {
|
|
3080
|
-
const metaData = this.chartData.metaData;
|
|
3081
|
-
const data = this.chartData.data;
|
|
3082
|
-
const colorType = metaData.colorType || 'high';
|
|
3083
|
-
const colorMaps = colorType === 'low'
|
|
3084
|
-
? this.chartConfiguration.low_colorMap
|
|
3085
|
-
: this.chartConfiguration.high_colorMap;
|
|
3086
3073
|
if (metaData.dataType) {
|
|
3087
|
-
this.dataType = metaData.dataType
|
|
3088
|
-
this.
|
|
3074
|
+
this.dataType = metaData.dataType;
|
|
3075
|
+
if (this.dataType == 'USD') {
|
|
3076
|
+
this.datatype_status = true;
|
|
3077
|
+
this.dataType = '$ ';
|
|
3078
|
+
}
|
|
3089
3079
|
}
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
56;
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
/**
|
|
3108
|
-
* Create SVG base container
|
|
3109
|
-
*/
|
|
3110
|
-
createSvgContainer(radius) {
|
|
3111
|
-
const margin = this.chartConfiguration.margin;
|
|
3112
|
-
const chartContainer = d3.select(this.containerElt.nativeElement);
|
|
3113
|
-
const width = parseInt(chartContainer.style('width'));
|
|
3114
|
-
const height = parseInt(chartContainer.style('height'));
|
|
3115
|
-
const svg = chartContainer
|
|
3080
|
+
data.map(function (dataUnit, i) {
|
|
3081
|
+
if (i < data.length - 1) {
|
|
3082
|
+
let diff = data[i + 1] - data[i];
|
|
3083
|
+
data_ready.push(diff);
|
|
3084
|
+
}
|
|
3085
|
+
});
|
|
3086
|
+
var chartContainer = d3.select(this.containerElt.nativeElement);
|
|
3087
|
+
var guagecontainer = d3.select(this.guagecontainerElt.nativeElement);
|
|
3088
|
+
var margin = this.chartConfiguration.margin;
|
|
3089
|
+
var width = parseInt(chartContainer.style('width')) - margin.left - margin.right;
|
|
3090
|
+
var height = parseInt(guagecontainer.style('height')) -
|
|
3091
|
+
margin.top -
|
|
3092
|
+
margin.bottom -
|
|
3093
|
+
56; //chart header height
|
|
3094
|
+
if (this.chartConfiguration.isHeaderVisible != undefined)
|
|
3095
|
+
this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
3096
|
+
var svg = chartContainer
|
|
3116
3097
|
.append('svg')
|
|
3117
|
-
.attr('id',
|
|
3118
|
-
.attr('width', width)
|
|
3119
|
-
.attr('height', height)
|
|
3098
|
+
.attr('id', self.uniqueId)
|
|
3099
|
+
.attr('width', width + margin.left + margin.right)
|
|
3100
|
+
.attr('height', height + margin.top + margin.bottom)
|
|
3120
3101
|
.call(ChartHelper.responsivefy)
|
|
3121
|
-
.append('g')
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3102
|
+
.append('g');
|
|
3103
|
+
var radius = Math.min(width, height) / 2;
|
|
3104
|
+
if (this.chartConfiguration.isDrilldownChart) {
|
|
3105
|
+
this.chartConfiguration.currentValueWidthScaleFactor += 40;
|
|
3106
|
+
this.chartConfiguration.currentValueHeightScaleFactor += 20;
|
|
3107
|
+
}
|
|
3108
|
+
else {
|
|
3109
|
+
if (window.innerWidth > 1400) {
|
|
3110
|
+
this.chartConfiguration.currentValueHeightScaleFactor += 15;
|
|
3111
|
+
this.chartConfiguration.currentValueWidthScaleFactor *= 2;
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
let topTextPosition = radius / 2 - 10;
|
|
3115
|
+
let midTextPosition = topTextPosition + this.chartConfiguration.currentValueHeightScaleFactor;
|
|
3116
|
+
let bottomTextPosition = midTextPosition + this.chartConfiguration.currentValueHeightScaleFactor;
|
|
3117
|
+
var data_length = data.length;
|
|
3118
|
+
function deg2rad(deg) {
|
|
3119
|
+
return (deg * Math.PI) / 180;
|
|
3120
|
+
}
|
|
3121
|
+
let tempArray = [];
|
|
3122
|
+
let total = 0;
|
|
3123
|
+
data_ready.map(function (unit) {
|
|
3124
|
+
total += unit;
|
|
3125
|
+
});
|
|
3126
|
+
data_ready.map(function (unit, i) {
|
|
3127
|
+
var angle = (unit / total) * 180;
|
|
3128
|
+
if (i === 0) {
|
|
3129
|
+
tempArray.push(angle);
|
|
3130
|
+
}
|
|
3131
|
+
else {
|
|
3132
|
+
let currentAngle = tempArray[i - 1] + angle;
|
|
3133
|
+
tempArray.push(currentAngle);
|
|
3134
|
+
}
|
|
3135
|
+
});
|
|
3136
|
+
angleValue = tempArray;
|
|
3137
|
+
var arc = d3
|
|
3130
3138
|
.arc()
|
|
3131
|
-
.innerRadius(
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
.outerRadius(
|
|
3135
|
-
.startAngle((
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3139
|
+
.innerRadius(radius -
|
|
3140
|
+
self.chartConfiguration.ringWidth -
|
|
3141
|
+
self.chartConfiguration.ringInset)
|
|
3142
|
+
.outerRadius(radius)
|
|
3143
|
+
.startAngle(function (d, i) {
|
|
3144
|
+
var ratio;
|
|
3145
|
+
if (i === 0) {
|
|
3146
|
+
ratio = self.chartConfiguration.minAngle;
|
|
3147
|
+
}
|
|
3148
|
+
else {
|
|
3149
|
+
ratio = self.chartConfiguration.minAngle + angleValue[i - 1];
|
|
3150
|
+
}
|
|
3151
|
+
return deg2rad(ratio);
|
|
3152
|
+
})
|
|
3153
|
+
.endAngle(function (d, i) {
|
|
3154
|
+
var ratio;
|
|
3155
|
+
if (i === data_ready.length - 1) {
|
|
3156
|
+
ratio = self.chartConfiguration.maxAngle;
|
|
3157
|
+
}
|
|
3158
|
+
else {
|
|
3159
|
+
ratio = self.chartConfiguration.minAngle + angleValue[i];
|
|
3160
|
+
}
|
|
3161
|
+
return deg2rad(ratio);
|
|
3162
|
+
});
|
|
3163
|
+
function centerTranslation() {
|
|
3164
|
+
return 'translate(' + radius + ',' + radius + ')';
|
|
3165
|
+
}
|
|
3166
|
+
var centerTx = centerTranslation();
|
|
3167
|
+
var tickData = d3
|
|
3168
|
+
.range(self.chartConfiguration.majorTicks)
|
|
3169
|
+
.map(function (i) {
|
|
3170
|
+
return 1 / self.chartConfiguration.majorTicks;
|
|
3171
|
+
});
|
|
3172
|
+
var arcs = svg.append('g').attr('class', 'arc').attr('transform', centerTx);
|
|
3173
|
+
arcs
|
|
3141
3174
|
.selectAll('path')
|
|
3142
3175
|
.data(data_ready)
|
|
3143
3176
|
.enter()
|
|
3144
3177
|
.append('path')
|
|
3145
|
-
.
|
|
3178
|
+
.on('click', function (d) {
|
|
3179
|
+
if (!metaData.hasDrillDown || metaData.currentValue == 0) {
|
|
3180
|
+
return;
|
|
3181
|
+
}
|
|
3182
|
+
let range = getRange(d);
|
|
3183
|
+
self.handleClick(range);
|
|
3184
|
+
})
|
|
3185
|
+
.attr('fill', function (d, i) {
|
|
3186
|
+
return colorMaps[i];
|
|
3187
|
+
})
|
|
3188
|
+
.attr('id', function (d, i) {
|
|
3189
|
+
return colorMaps[i];
|
|
3190
|
+
})
|
|
3146
3191
|
.attr('d', arc)
|
|
3147
|
-
.style('cursor',
|
|
3148
|
-
.
|
|
3149
|
-
if (
|
|
3150
|
-
|
|
3192
|
+
// .style('cursor', 'pointer');
|
|
3193
|
+
.style('cursor', function (d) {
|
|
3194
|
+
if (metaData.currentValue > 0 && metaData.hasDrillDown && !isria)
|
|
3195
|
+
return 'pointer';
|
|
3196
|
+
else
|
|
3197
|
+
return 'default';
|
|
3151
3198
|
});
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
this.chartData.data[0];
|
|
3160
|
-
const pointerAngle = this.chartConfiguration.minAngle + (pointerValue / range) * 180;
|
|
3161
|
-
const pointerHeadLength = Math.round(radius * this.chartConfiguration.pointerHeadLengthPercent);
|
|
3162
|
-
const lineData = [
|
|
3163
|
-
[this.chartConfiguration.pointerWidth / 2, 0],
|
|
3199
|
+
let getRange = function (d) {
|
|
3200
|
+
let index = data_ready.indexOf(d);
|
|
3201
|
+
return data[0] + ' and ' + data[data.length - 1];
|
|
3202
|
+
};
|
|
3203
|
+
let pointerHeadLength = Math.round(radius * self.chartConfiguration.pointerHeadLengthPercent);
|
|
3204
|
+
var lineData = [
|
|
3205
|
+
[self.chartConfiguration.pointerWidth / 2, 0],
|
|
3164
3206
|
[0, -pointerHeadLength],
|
|
3165
|
-
[-
|
|
3166
|
-
[0,
|
|
3167
|
-
[
|
|
3207
|
+
[-(self.chartConfiguration.pointerWidth / 2), 0],
|
|
3208
|
+
[0, self.chartConfiguration.pointerTailLength],
|
|
3209
|
+
[self.chartConfiguration.pointerWidth / 2, 0],
|
|
3168
3210
|
];
|
|
3169
|
-
|
|
3211
|
+
var pointerLine = d3.line();
|
|
3212
|
+
var pg = svg
|
|
3170
3213
|
.append('g')
|
|
3214
|
+
.data([lineData])
|
|
3171
3215
|
.attr('class', 'pointer')
|
|
3172
|
-
.
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3216
|
+
.attr('transform', centerTx);
|
|
3217
|
+
var pointerValue = metaData.currentValue - data[0];
|
|
3218
|
+
var range = data[data_length - 1] - data[0];
|
|
3219
|
+
var pointerAngle = self.chartConfiguration.minAngle + (pointerValue / range) * 180;
|
|
3220
|
+
pg.append('path')
|
|
3221
|
+
.attr('d', pointerLine)
|
|
3222
|
+
.attr('fill', self.chartConfiguration.pointerColor)
|
|
3223
|
+
.attr('transform', 'rotate(' +
|
|
3224
|
+
pointerAngle +
|
|
3225
|
+
') translate(0,' +
|
|
3226
|
+
(-radius + self.chartConfiguration.ringWidth + pointerHeadLength) +
|
|
3227
|
+
')');
|
|
3228
|
+
var lg = svg.append('g').attr('class', 'label').attr('transform', centerTx);
|
|
3229
|
+
let labelArrayTemp = [{ name: data[0], value: 0 }];
|
|
3230
|
+
let count = 0;
|
|
3231
|
+
data_ready.map(function (dataUnit, i) {
|
|
3232
|
+
count += dataUnit;
|
|
3233
|
+
let temp = { name: data[i + 1], value: count };
|
|
3234
|
+
labelArrayTemp.push(temp);
|
|
3235
|
+
});
|
|
3236
|
+
labelArray = labelArrayTemp;
|
|
3237
|
+
lg.selectAll('.bubble')
|
|
3194
3238
|
.data(labelArray)
|
|
3195
3239
|
.enter()
|
|
3240
|
+
.append('g')
|
|
3241
|
+
.attr('transform', function (d) {
|
|
3242
|
+
var newAngle = self.chartConfiguration.minAngle + (d.value / range) * 180;
|
|
3243
|
+
return ('rotate(' +
|
|
3244
|
+
newAngle +
|
|
3245
|
+
') translate(0,' +
|
|
3246
|
+
(self.chartConfiguration.labelInset - radius - 20) +
|
|
3247
|
+
')');
|
|
3248
|
+
})
|
|
3249
|
+
.append('g')
|
|
3250
|
+
.attr('transform', function (d, i) {
|
|
3251
|
+
var newAngle = self.chartConfiguration.minAngle + (d.value / range) * 180;
|
|
3252
|
+
if (i == 0 && self.chartConfiguration.isValueLableAdjust) {
|
|
3253
|
+
return 'rotate(' + (0 - newAngle) + ') translate(-27,0)';
|
|
3254
|
+
}
|
|
3255
|
+
if (i == labelArray.length - 1 &&
|
|
3256
|
+
self.chartConfiguration.isValueLableAdjust) {
|
|
3257
|
+
return 'rotate(' + (0 - newAngle) + ') translate(-15,0)';
|
|
3258
|
+
}
|
|
3259
|
+
return 'rotate(' + (0 - newAngle) + ') translate(-17,0)';
|
|
3260
|
+
})
|
|
3196
3261
|
.append('text')
|
|
3197
|
-
.attr('
|
|
3198
|
-
|
|
3199
|
-
|
|
3262
|
+
.attr('style', function (d) {
|
|
3263
|
+
if (window.innerWidth < 1400)
|
|
3264
|
+
return 'font-size: ' + '12px' + '; font-weight:' + '600;';
|
|
3265
|
+
else
|
|
3266
|
+
return 'font-size: ' + '14px' + '; font-weight:' + '600;';
|
|
3200
3267
|
})
|
|
3201
3268
|
.attr('fill', 'var(--chart-text-color)')
|
|
3202
|
-
.
|
|
3203
|
-
.
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
*/
|
|
3209
|
-
drawTexts(svg, metaData, radius) {
|
|
3210
|
-
const topY = radius / 2 - 10;
|
|
3211
|
-
const midY = topY + this.chartConfiguration.currentValueHeightScaleFactor;
|
|
3212
|
-
const bottomY = midY + this.chartConfiguration.currentValueHeightScaleFactor;
|
|
3269
|
+
.text(function (d) {
|
|
3270
|
+
if (metaData.dataType) {
|
|
3271
|
+
return d.name + metaData.dataType;
|
|
3272
|
+
}
|
|
3273
|
+
return d.name;
|
|
3274
|
+
});
|
|
3213
3275
|
svg
|
|
3214
3276
|
.append('foreignObject')
|
|
3215
|
-
.attr('transform',
|
|
3216
|
-
|
|
3217
|
-
|
|
3277
|
+
.attr('transform', 'translate(' +
|
|
3278
|
+
(radius - this.chartConfiguration.currentValueWidthScaleFactor / 2) +
|
|
3279
|
+
',' +
|
|
3280
|
+
topTextPosition +
|
|
3281
|
+
')')
|
|
3282
|
+
.attr('width', this.chartConfiguration.currentValueWidthScaleFactor + 8)
|
|
3283
|
+
.attr('height', this.chartConfiguration.currentValueHeightScaleFactor)
|
|
3218
3284
|
.append('xhtml:div')
|
|
3219
3285
|
.attr('class', 'value-display')
|
|
3220
|
-
.
|
|
3286
|
+
.style('height', this.chartConfiguration.currentValueHeightScaleFactor + 10 + 'px')
|
|
3287
|
+
.style('font-size', function () {
|
|
3288
|
+
if (window.innerWidth > 1500) {
|
|
3289
|
+
self.chartConfiguration.currentValueHeightScaleFactor - 25 + 'px';
|
|
3290
|
+
}
|
|
3291
|
+
else {
|
|
3292
|
+
self.chartConfiguration.currentValueHeightScaleFactor - 15 + 'px';
|
|
3293
|
+
}
|
|
3294
|
+
})
|
|
3295
|
+
.html(metaData.currentValue + metaData.dataType);
|
|
3221
3296
|
if (metaData.status) {
|
|
3297
|
+
let widthTemp = metaData.status.length > 4 ? 210 : 120;
|
|
3222
3298
|
svg
|
|
3223
3299
|
.append('foreignObject')
|
|
3224
|
-
.attr('transform',
|
|
3225
|
-
.attr('width',
|
|
3226
|
-
.attr('height',
|
|
3300
|
+
.attr('transform', 'translate(' + (radius - widthTemp / 2) + ',' + midTextPosition + ')')
|
|
3301
|
+
.attr('width', widthTemp)
|
|
3302
|
+
.attr('height', this.chartConfiguration.currentValueHeightScaleFactor + 10)
|
|
3227
3303
|
.append('xhtml:div')
|
|
3228
3304
|
.attr('class', 'status-display')
|
|
3305
|
+
.style('font-size', this.chartConfiguration.currentValueHeightScaleFactor - 25 + 'px')
|
|
3229
3306
|
.html(metaData.status);
|
|
3230
3307
|
}
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3308
|
+
svg
|
|
3309
|
+
.append('foreignObject')
|
|
3310
|
+
.attr('transform', 'translate(' + (radius - 105) + ',' + bottomTextPosition + ')')
|
|
3311
|
+
.attr('width', 210)
|
|
3312
|
+
.attr('height', this.chartConfiguration.currentValueHeightScaleFactor)
|
|
3313
|
+
.append('xhtml:div')
|
|
3314
|
+
.attr('class', 'daterange-display')
|
|
3315
|
+
.style('font-size', function () {
|
|
3316
|
+
if (self.chartConfiguration.isDrilldownChart) {
|
|
3317
|
+
{
|
|
3318
|
+
if (window.innerWidth < 1400)
|
|
3319
|
+
return '14px';
|
|
3320
|
+
else
|
|
3321
|
+
return '18px';
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
else {
|
|
3325
|
+
if (window.innerWidth < 1400)
|
|
3326
|
+
return '14px';
|
|
3327
|
+
else
|
|
3328
|
+
return '18px';
|
|
3329
|
+
}
|
|
3330
|
+
})
|
|
3331
|
+
.html(function () {
|
|
3332
|
+
var desiredSize;
|
|
3333
|
+
if (window.innerWidth < 1400)
|
|
3334
|
+
desiredSize = '14px';
|
|
3335
|
+
else
|
|
3336
|
+
desiredSize = '18px';
|
|
3337
|
+
if (metaData.dateRange)
|
|
3338
|
+
return ('<span class="marginright-3"><i class="fa fa-calendar"></i></span><span> ' +
|
|
3339
|
+
metaData.dateRange +
|
|
3340
|
+
'</span>');
|
|
3341
|
+
else
|
|
3342
|
+
return '';
|
|
3343
|
+
});
|
|
3344
|
+
var containerMidWidth = parseInt(chartContainer.style('width')) / 2;
|
|
3345
|
+
var nodeHalfWidth = svg.node().getBoundingClientRect().width / 2;
|
|
3346
|
+
var updatedStartingPoint = containerMidWidth - nodeHalfWidth;
|
|
3347
|
+
svg.attr('transform', 'translate(' +
|
|
3348
|
+
(updatedStartingPoint + margin.left) +
|
|
3349
|
+
',' +
|
|
3350
|
+
margin.top +
|
|
3351
|
+
')');
|
|
3245
3352
|
}
|
|
3246
3353
|
handleClick(d) {
|
|
3247
3354
|
this.clickEvent.emit(d);
|