plotly / plotly/angular-plotly.js
Plotly table is not working
還沒有人認領這個 Issue。
- 主要語言
- TypeScript
- 星號
- 242
- 分支
- 81
- 平均合併
- 8 小時 48 分鐘
- 30 天內合併 PR
- 18
描述
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">
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先使用所示的 PlotlyViaCDNModule 設定和表格資料,重現 app.module.ts、app.component.ts 與 app.component.html 中的空白表格。將其與可正常運作的折線圖或散佈圖範例進行比較;當提供的表格能在 Angular 元件中正確呈現時,該 issue 即完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- angular, typescript
- 領域
- frontend
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100