mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 17:15:17 +00:00
Merge pull request #128 from EverythingMe/fix_visualizations_issues
Several visualizations related fixes.
This commit is contained in:
commit
5e72cc61b6
@ -124,7 +124,7 @@
|
||||
enabled: true,
|
||||
color: '#000000',
|
||||
connectorColor: '#000000',
|
||||
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
|
||||
format: '<b>{point.name}</b>: {point.y} ({point.percentage:.1f} %)'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
|
@ -16,7 +16,10 @@ renderers.directive('pivotTableRenderer', function () {
|
||||
|
||||
if ($scope.queryResult.getData() == null) {
|
||||
} else {
|
||||
$(element).pivotUI($scope.queryResult.getData(), {
|
||||
// We need to give the pivot table its own copy of the data, because its change
|
||||
// it which interferes with other visualizations.
|
||||
var data = $.extend(true, [], $scope.queryResult.getData());
|
||||
$(element).pivotUI(data, {
|
||||
renderers: $.pivotUtilities.renderers
|
||||
}, true);
|
||||
}
|
||||
|
@ -112,9 +112,9 @@
|
||||
}, true);
|
||||
}
|
||||
|
||||
scope.$watch('visualization.type', function (type) {
|
||||
scope.$watch('visualization.type', function (type, oldType) {
|
||||
// if not edited by user, set name to match type
|
||||
if (type && scope.visualization && !scope.visForm.name.$dirty) {
|
||||
if (type && oldType != type && scope.visualization && !scope.visForm.name.$dirty) {
|
||||
// poor man's titlecase
|
||||
scope.visualization.name = scope.visualization.type[0] + scope.visualization.type.slice(1).toLowerCase();
|
||||
}
|
||||
|
@ -63,7 +63,13 @@
|
||||
columnDefinition['formatParameter'] = 2;
|
||||
} else if (moment.isMoment(exampleData)) {
|
||||
columnDefinition['formatFunction'] = function(value) {
|
||||
return value.format("DD/MM/YY HH:mm");
|
||||
// TODO: this is very hackish way to determine if we need
|
||||
// to show the value as a time or date only. Better solution
|
||||
// is to complete #70 and use the information it returns.
|
||||
if (value._i.match(/^\d{4}-\d{2}-\d{2}T/)) {
|
||||
return value.format("DD/MM/YY HH:mm");
|
||||
}
|
||||
return value.format("DD/MM/YY");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user