Angular RadCartesianChart空白屏幕

Angular RadCartesianChart空白屏幕,angular,typescript,nativescript,nativescript-angular,Angular,Typescript,Nativescript,Nativescript Angular,我是Nativescript开发新手,我试图在我的应用程序中使用Nativescript ui图表,但当我加载我编写的页面时,屏幕变为空白,没有显示任何内容 我遵循这个指南。 我还从GitHub下载并测试了示例代码,它是有效的:但当我复制代码时,它会执行与我之前所说的相同的操作 在这一点上,我认为这与我使用的库有关,可能与图表不兼容 我使用了我在上面发布的链接上找到的相同代码 <RadCartesianChart> <CategoricalAxis tkCartesian

我是Nativescript开发新手,我试图在我的应用程序中使用Nativescript ui图表,但当我加载我编写的页面时,屏幕变为空白,没有显示任何内容

我遵循这个指南。 我还从GitHub下载并测试了示例代码,它是有效的:但当我复制代码时,它会执行与我之前所说的相同的操作

在这一点上,我认为这与我使用的库有关,可能与图表不兼容

我使用了我在上面发布的链接上找到的相同代码

<RadCartesianChart>
   <CategoricalAxis tkCartesianHorizontalAxis></CategoricalAxis>
   <LinearAxis tkCartesianVerticalAxis></LinearAxis>
   <LineSeries tkCartesianSeries [items]="categoricalSource" 
               categoryProperty="Country" valueProperty="Amount">
   </LineSeries>
</RadCartesianChart>

从'@angular/core'导入{Injectable};
@可注射()
导出类数据服务{
getCategoricalSource():国家[]{
返回[
{国家:“德国”,金额:15,第二个VAL:14,第三个VAL:24,影响:0,年份:0},
{国家:“法国”,金额:13,第二个VAL:23,第三个VAL:25,影响:0,年份:0},
{国家:“保加利亚”,金额:24,第二个VAL:17,第三个VAL:23,影响:0,年份:0},
{国家:“西班牙”,金额:11,第二个VAL:19,第三个VAL:24,影响:0,年份:0},
{国家:“美国”,金额:18,第二个VAL:8,第三个VAL:21,影响:0,年份:0}
];
}
}
@组成部分({
选择器:“ns服务详细信息”,
templateUrl:“./service detail.component.html”,
样式URL:[“/service detail.component.scss”],
moduleId:module.id,
提供者:[数据服务],
})
导出类ServiceDetailComponent{
恩戈尼尼特(){
this.\u categoricalSource=新的ObservableArray(this.\u dataService.getCategoricalSource());
}
私有分类来源:ObservableArray;
get categoricalSource():ObservalArray{
返回此。\u categoricalSource;
}
}
出口级国家{
构造函数(公共国家/地区?:字符串,公共金额?:编号,公共二次值?:编号,公共三次值?:编号,公共影响?:编号,公共年度?:编号){
}
}

在控制台日志中,我看不到任何错误,因此调试它非常困难。

我创建了一个游戏场。您应该将图表包装在布局中

<GridLayout rows="*" height="1000px">
                <RadCartesianChart row="0">
                    <CategoricalAxis tkCartesianHorizontalAxis></CategoricalAxis>
                    <LinearAxis tkCartesianVerticalAxis></LinearAxis>
                    <LineSeries tkCartesianSeries [items]="categoricalSource"
                        categoryProperty="Country" valueProperty="Amount"></LineSeries>
                </RadCartesianChart>
            </GridLayout>

我已经创建了一个游乐场。您应该将图表包装在布局中

<GridLayout rows="*" height="1000px">
                <RadCartesianChart row="0">
                    <CategoricalAxis tkCartesianHorizontalAxis></CategoricalAxis>
                    <LinearAxis tkCartesianVerticalAxis></LinearAxis>
                    <LineSeries tkCartesianSeries [items]="categoricalSource"
                        categoryProperty="Country" valueProperty="Amount"></LineSeries>
                </RadCartesianChart>
            </GridLayout>


您需要将html代码放入布局中。使用StackLayout或GridLayout。如果可能的话,你能试着展示你的问题吗?你需要把你的html代码放在一个布局中。使用StackLayout或GridLayout。如果可能的话,您可以尝试显示您的问题吗?好的,现在我可以看到GridLayout,但图表仍然不可见。我查看了您的代码,找到了问题所在。。。我忘了导入NativeScriptUIChartModuleOk,现在我可以看到GridLayout,但图表仍然不可见。我查看了您的代码,发现了问题所在。。。我忘记导入NativeScriptUIChartModule