plotly / plotly/angular-plotly.js

Plotly table is not working

Aberta
#169 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Linguagem predominante
TypeScript
Estrelas
242
Forks
81
Merge médio
8h 48min
PRs com merge (30d)
18

Descrição

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">

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece reproduzindo a tabela vazia de app.module.ts, app.component.ts e app.component.html usando a configuração mostrada de PlotlyViaCDNModule e os dados da tabela. Compare-a com os exemplos funcionais de gráficos de linha ou de dispersão; o issue estará concluído quando a tabela fornecida for renderizada corretamente no componente Angular.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
angular, typescript
Domínio
frontend
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
42/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.