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