Skip to content

Commit

Permalink
Closes #2541: x-axis improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina Samuel committed May 31, 2018
1 parent 90d642f commit 8046030
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions client/app/visualizations/chart/chart-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@
<div class="form-group">
<label class="control-label">Scale</label>
<ui-select ng-model="options.xAxis.type">
<ui-select-match placeholder="Choose Scale...">{{$select.selected | capitalize}}</ui-select-match>
<ui-select-choices repeat="scaleType in xAxisScales">
<div ng-bind-html="scaleType | capitalize | highlight: $select.search"></div>
<ui-select-match placeholder="Choose Scale...">{{$select.selected.label}}</ui-select-match>
<ui-select-choices repeat="scaleType.value as scaleType in xAxisScales">
<div ng-bind-html="scaleType.label | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
Expand Down
10 changes: 8 additions & 2 deletions client/app/visualizations/chart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DEFAULT_OPTIONS = {
sortX: true,
legend: { enabled: true },
yAxis: [{ type: 'linear' }, { type: 'linear', opposite: true }],
xAxis: { type: 'datetime', labels: { enabled: true } },
xAxis: { type: '-', labels: { enabled: true } },
error_y: { type: 'data', visible: true },
series: { stacking: null, error_y: { type: 'data', visible: true } },
seriesOptions: {},
Expand Down Expand Up @@ -103,7 +103,13 @@ function ChartEditor(ColorPalette, clientConfig) {
scope.chartTypes.custom = { name: 'Custom', icon: 'code' };
}

scope.xAxisScales = ['datetime', 'linear', 'logarithmic', 'category'];
scope.xAxisScales = [
{ label: 'Auto Detect', value: '-' },
{ label: 'Datetime', value: 'datetime' },
{ label: 'Linear', value: 'linear' },
{ label: 'Logarithmic', value: 'logarithmic' },
{ label: 'Category', value: 'category' },
];
scope.yAxisScales = ['linear', 'logarithmic', 'datetime', 'category'];

scope.chartTypeChanged = () => {
Expand Down

0 comments on commit 8046030

Please sign in to comment.