Skip to content

Commit 53527ec

Browse files
authored
Merge pull request patternfly#267 from jeff-phillips-18/fixes
Fix donut pct, line, and sparkline charts to update when config or da…
2 parents d78836a + e141efe commit 53527ec

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/charts/donut/donut-pct-chart-directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', function (pfUti
378378

379379
$scope.updateAll = function (scope) {
380380
$scope.updateAvailable();
381-
$scope.config.data = pfUtils.merge($scope.getDonutData($scope), $scope.config.data);
381+
$scope.config.data = pfUtils.merge($scope.config.data, $scope.getDonutData($scope));
382382
$scope.config.color = $scope.statusDonutColor($scope);
383383
$scope.config.tooltip = donutTooltip(scope);
384384
$scope.config.data.onclick = $scope.config.onClickFn;

src/charts/line/line-chart.directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ angular.module('patternfly.charts').directive('pfLineChart', function (pfUtils)
213213
link: function (scope) {
214214
scope.$watch('config', function () {
215215
scope.config.data = pfUtils.merge(scope.config.data, scope.getLineData(scope.chartData));
216-
scope.chartConfig = pfUtils.merge(scope.config, scope.defaultConfig);
216+
scope.chartConfig = pfUtils.merge(scope.defaultConfig, scope.config);
217217
}, true);
218218
scope.$watch('showXAxis', function () {
219219
scope.chartConfig.axis.x.show = scope.showXAxis === true;

src/charts/sparkline/sparkline-chart.directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,14 @@ angular.module('patternfly.charts').directive('pfSparklineChart', function (pfUt
310310
$scope.config.data = pfUtils.merge($scope.config.data, $scope.getSparklineData($scope.chartData));
311311

312312
// Override defaults with callers specifications
313-
$scope.chartConfig = pfUtils.merge($scope.config, $scope.defaultConfig);
313+
$scope.chartConfig = pfUtils.merge($scope.defaultConfig, $scope.config);
314314
}
315315
],
316316

317317
link: function (scope) {
318318
scope.$watch('config', function () {
319319
scope.config.data = pfUtils.merge(scope.config.data, scope.getSparklineData(scope.chartData));
320-
scope.chartConfig = pfUtils.merge(scope.config, scope.defaultConfig);
320+
scope.chartConfig = pfUtils.merge(scope.defaultConfig, scope.config);
321321
}, true);
322322
scope.$watch('chartHeight', function () {
323323
if (scope.chartHeight) {

0 commit comments

Comments
 (0)