I am trying to remove the modebar and scrollzoom in my plotly plot while using angular. I know how to remove them in python but unable to do so in the below code. Any help is much appreciated.
import { Component } from '@angular/core';
@Component({
    selector: 'plotly-example',
    template: '<plotly-plot [data]="graph.data" [layout]="graph.layout"></plotly-plot>',
})
export class PlotlyExampleComponent {
    public graph = {
        data: [
            { x: [1, 2, 3], y: [2, 6, 3], type: 'scatter', mode: 'lines+points', marker: {color: 'red'} },
            { x: [1, 2, 3], y: [2, 5, 3], type: 'bar' },
        ],
        layout: {width: 320, height: 240, title: 'A Fancy Plot'}
    };
}
                Add
graph = {
  ...
  config: {
    displayModeBar: false  
  }
}
and
<plotly-plot [data]="graph.data" [layout]="graph.layout" [config]="graph.config"></plotly-plot>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With