make tic labels optional for bar charts
This commit is contained in:
@@ -202,6 +202,7 @@ export class PlotRequest {
|
|||||||
generateThumbnail : boolean;
|
generateThumbnail : boolean;
|
||||||
intervalUnit: string;
|
intervalUnit: string;
|
||||||
intervalValue: number;
|
intervalValue: number;
|
||||||
|
renderBarChartTickLabels: boolean = false;
|
||||||
|
|
||||||
copy(): PlotRequest {
|
copy(): PlotRequest {
|
||||||
return JSON.parse(JSON.stringify(this));
|
return JSON.parse(JSON.stringify(this));
|
||||||
|
|||||||
@@ -46,6 +46,9 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
<div [hidden]="!selectedPlotTypesContains('BAR')">
|
||||||
|
<mat-checkbox [(ngModel)]="renderBarChartTickLabels">Show Tic Labels (bar chart)</mat-checkbox>
|
||||||
|
</div>
|
||||||
<pdb-y-axis-definition #y1AxisDefinitionComponent yIndex="1"></pdb-y-axis-definition>
|
<pdb-y-axis-definition #y1AxisDefinitionComponent yIndex="1"></pdb-y-axis-definition>
|
||||||
<pdb-y-axis-definition #y2AxisDefinitionComponent yIndex="2" [hidden]="!y2AxisAvailable"></pdb-y-axis-definition>
|
<pdb-y-axis-definition #y2AxisDefinitionComponent yIndex="2" [hidden]="!y2AxisAvailable"></pdb-y-axis-definition>
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export class VisualizationPageComponent implements OnInit {
|
|||||||
|
|
||||||
intervalUnit = 'NO_INTERVAL';
|
intervalUnit = 'NO_INTERVAL';
|
||||||
intervalValue = 1;
|
intervalValue = 1;
|
||||||
|
renderBarChartTickLabels = false;
|
||||||
|
|
||||||
constructor(private plotService: PlotService, private snackBar: MatSnackBar) {
|
constructor(private plotService: PlotService, private snackBar: MatSnackBar) {
|
||||||
}
|
}
|
||||||
@@ -172,6 +173,7 @@ export class VisualizationPageComponent implements OnInit {
|
|||||||
request.generateThumbnail = this.enableGallery;
|
request.generateThumbnail = this.enableGallery;
|
||||||
request.intervalUnit = this.intervalUnit;
|
request.intervalUnit = this.intervalUnit;
|
||||||
request.intervalValue = this.intervalValue;
|
request.intervalValue = this.intervalValue;
|
||||||
|
request.renderBarChartTickLabels = this.renderBarChartTickLabels;
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class BarChartHandler extends AggregateHandler {
|
|||||||
appendln(result, barAggregator.asCsv(settings.isRenderLabels()));
|
appendln(result, barAggregator.asCsv(settings.isRenderLabels()));
|
||||||
appendln(result, "EOD");
|
appendln(result, "EOD");
|
||||||
|
|
||||||
if (settings.isRenderLabels()) {
|
if (settings.isRenderLabels() && settings.isRenderBarChartTickLabels()) {
|
||||||
appendfln(result, barAggregator.renderLabels(getxAxis()));
|
appendfln(result, barAggregator.renderLabels(getxAxis()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public class PlotSettings {
|
|||||||
|
|
||||||
private Interval interval;
|
private Interval interval;
|
||||||
|
|
||||||
|
private boolean renderBarChartTickLabels;
|
||||||
|
|
||||||
public String getQuery() {
|
public String getQuery() {
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
@@ -197,4 +199,12 @@ public class PlotSettings {
|
|||||||
this.interval = interval;
|
this.interval = interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRenderBarChartTickLabels() {
|
||||||
|
return renderBarChartTickLabels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRenderBarChartTickLabels(final boolean renderBarChartTickLabels) {
|
||||||
|
this.renderBarChartTickLabels = renderBarChartTickLabels;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ public class GnuplotSettings {
|
|||||||
private AxisSettings xAxisSettings = new AxisSettings();
|
private AxisSettings xAxisSettings = new AxisSettings();
|
||||||
private boolean renderLabels = true;
|
private boolean renderLabels = true;
|
||||||
private DateTimeRange dateTimeRange;
|
private DateTimeRange dateTimeRange;
|
||||||
|
private boolean renderBarChartTickLabels;
|
||||||
|
|
||||||
public GnuplotSettings(final Path output) {
|
public GnuplotSettings(final Path output) {
|
||||||
this.output = output;
|
this.output = output;
|
||||||
@@ -151,6 +152,14 @@ public class GnuplotSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRenderBarChartTickLabels() {
|
||||||
|
return renderBarChartTickLabels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRenderBarChartTickLabels(final boolean renderBarChartTickLabels) {
|
||||||
|
this.renderBarChartTickLabels = renderBarChartTickLabels;
|
||||||
|
}
|
||||||
|
|
||||||
// plot 'sample.txt' using 1:2 title 'Bytes' with linespoints 2
|
// plot 'sample.txt' using 1:2 title 'Bytes' with linespoints 2
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public class Plotter {
|
|||||||
|
|
||||||
gnuplotSettings.setAggregates(plotSettings.getAggregates());
|
gnuplotSettings.setAggregates(plotSettings.getAggregates());
|
||||||
gnuplotSettings.setKeyOutside(plotSettings.isKeyOutside());
|
gnuplotSettings.setKeyOutside(plotSettings.isKeyOutside());
|
||||||
|
gnuplotSettings.setRenderBarChartTickLabels(plotSettings.isRenderBarChartTickLabels());
|
||||||
gnuplot.plot(gnuplotSettings, dataSeries);
|
gnuplot.plot(gnuplotSettings, dataSeries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class PlotSettingsTransformer {
|
|||||||
result.setY2(request.getY2());
|
result.setY2(request.getY2());
|
||||||
result.setAggregates(toAggregateInternal(request.getY1(), request.getY2(), request.getAggregates()));
|
result.setAggregates(toAggregateInternal(request.getY1(), request.getY2(), request.getAggregates()));
|
||||||
result.setInterval(Interval.create(request.getIntervalUnit(), request.getIntervalValue(), result.dateRange()));
|
result.setInterval(Interval.create(request.getIntervalUnit(), request.getIntervalValue(), result.dateRange()));
|
||||||
|
result.setRenderBarChartTickLabels(request.isRenderBarChartTickLabels());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ public class PlotRequest {
|
|||||||
private String intervalUnit;
|
private String intervalUnit;
|
||||||
private int intervalValue;
|
private int intervalValue;
|
||||||
|
|
||||||
|
private boolean renderBarChartTickLabels;
|
||||||
|
|
||||||
public String getQuery() {
|
public String getQuery() {
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
@@ -169,4 +171,12 @@ public class PlotRequest {
|
|||||||
public void setIntervalValue(final int intervalValue) {
|
public void setIntervalValue(final int intervalValue) {
|
||||||
this.intervalValue = intervalValue;
|
this.intervalValue = intervalValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRenderBarChartTickLabels() {
|
||||||
|
return renderBarChartTickLabels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRenderBarChartTickLabels(final boolean renderBarChartTickLabels) {
|
||||||
|
this.renderBarChartTickLabels = renderBarChartTickLabels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user