我正在使用以下功能打开对话框:
doOutput(){
this.dialog.open(NgxChartsComponent ) ;
}
我的NgxChartsComponent
的HTML代码是:
<!-- The chart type goes in here -->
<div> This is a visual representation of a line chart</div>
<div style="display: inline-block">
<ngx-charts-line-chart
[view]="view"
[scheme]="colorScheme"
[results]="multi"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[xAxisLabel]="xAxisLabel"
[yAxisLabel]="yAxisLabel"
[autoScale]="autoScale"
[timeline]="timeline"
(select)="onSelect($event)">
</ngx-charts-line-chart>
</div>
<br>
<div> This is a visual representation of a area chart</div>
<div style="display: inline-block">
<ngx-charts-area-chart
[view]="view"
[scheme]="colorScheme"
[results]="multi"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[xAxisLabel]="xAxisLabel"
[yAxisLabel]="yAxisLabel"
[autoScale]="autoScale"
(select)="onSelect($event)">
</ngx-charts-area-chart>
</div>
<br>
<div> This is a visual representation of a pie chart</div>
<div style="display: inline-block">
<ngx-charts-pie-chart
[view]="view"
[scheme]="colorScheme"
[results]="single"
[legend]="showLegend"
[explodeSlices]="explodeSlices"
[labels]="showLabels"
[doughnut]="doughnut"
[gradient]="gradient"
(select)="onSelect($event)">
</ngx-charts-pie-chart>
</div>
我使用MatDialog
和MatDialogRef
创建对话框,效果很好,但是我必须缩小屏幕才能看到对话框的全部内容,并且没有滚动功能!请帮助我知道如何将滚动条添加到弹出对话框窗口?
我认为您只需要对话框的css中的简单overflow: scroll;