Plotly table is not working

Offen
#169 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, typescript
Bereich
frontend

Rechercherichtung

Beginne damit, die leere Tabelle aus app.module.ts, app.component.ts und app.component.html mithilfe des gezeigten PlotlyViaCDNModule-Setups und der Tabellendaten zu reproduzieren. Vergleiche dies mit den funktionierenden Beispielen für Linien- oder Streudiagramme; das Issue ist abgeschlossen, wenn die bereitgestellte Tabelle in der Angular-Komponente korrekt gerendert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Problem Overview

  • plotly table is showing a blank chart in Angular solution
  • Note: I have tried the same thing a month back with plotly version 2.2.1 and it was working fine.

Steps Followed

  • Installed plotly in an Angular solution with below commands
    npm install plotly.js-dist --save
    npm install @types/plotly.js --save
    npm install @types/d3 --save

  • Rename folder "plotly.js" to "plotly.js-dist" in "node_modules/@types".

Line/Scatter plots works fine with this approach. However, table is showing an empty graph.

Also, tried with PlotlyViaCDNModule - still the issue is same

Below is how the angular component & module files

app.module.ts

import { PlotlyViaCDNModule } from 'angular-plotly.js';
import { CommonModule } from '@angular/common';

PlotlyViaCDNModule.setPlotlyVersion('1.55.2'); // can be latest or any version number (i.e.: '1.40.0')
PlotlyViaCDNModule.setPlotlyBundle('basic');
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
PlotlyViaCDNModule,
CommonModule
],

app.component.ts

export class AppComponent {
public values = [
['Salaries', 'Office', 'Merchandise', 'Legal', 'TOTAL'],
[1200000, 20000, 80000, 2000, 12120000],
[1300000, 20000, 70000, 2000, 130902000],
[1300000, 20000, 120000, 2000, 131222000],
[1400000, 20000, 90000, 2000, 14102000]]

public data = [{
type: 'table',
header: {
values: [["EXPENSES"], ["Q1"],
["Q2"], ["Q3"], ["Q4"]],
align: "center",
line: {width: 1, color: 'black'},
fill: {color: "grey"},
font: {family: "Arial", size: 12, color: "white"}
},
cells: {
values: this.values,
align: "center",
line: {color: "black", width: 1},
font: {family: "Arial", size: 11, color: ["black"]}
}
}]

constructor() {

}

}

app.component.html
<plotly-plot [data]="data">

Vorherrschende Sprache
TypeScript
Sterne
242
Forks
81
Ø Merge
8 Std. 48 Min.
Gemergte PRs (30 T.)
18

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus plotly/angular-plotly.js

Alle Issues in plotly/angular-plotly.js

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.