简体   繁体   English

折线图上的角度图错误:无法解析颜色

[英]angular-chart error on line chart: unable to parse color

I tried to create a bar chart and everything works fine. 我试图创建一个条形图,并且一切正常。 But when i create a line chart the following error is thrown: 但是,当我创建折线图时,会引发以下错误:

Uncaught Error: Unable to parse color from object ["rgba(167,199,230,1)","rgba(61,53,189,1)","rgba(120,87,48,1)","rgba(110,93,105,1)","rgba(112,33,221,1)","rgba(136,6,10,1)","rgba(154,2.. 未捕获的错误:无法解析对象[“ rgba(167,199,230,1)”,“ rgba(61,53,189,1)”,“ rgba(120,87,48,1)”,“ rgba(110,93,105, 1)“,” rgba(112,33,221,1)“,” rgba(136,6,10,1)“,” rgba(154,2 ..

I only have these options to set the color and the line chart itself: 我只有这些选项可以设置颜色和折线图本身:

 ChartJsProvider.setOptions({
    chartColors: ['#a7c7e6', '#4f8fcd', '#37648f', '#C7C7C7', '#2f557b', '#748ba1', '#536373', '#bfbdb6'],
    responsive: true
});

ChartJsProvider.setOptions('line', {
    showLines: true,
    fill: false
});

Somehow even the "fill: false" is not working, and when i hover over the points the error shown below is thrown.. My canvas looks like this: 不知何故,即使“ fill:false”也不起作用,当我将鼠标悬停在这些点上时,将引发以下所示的错误。我的画布看起来像这样:

<canvas class="chart chart-line" chart-data="data" chart-labels="labels" chart-options="options"></canvas>

I have no idea what i did wrong and somehow i found nothing on the internet that could solve my problem.. maybe someone can help? 我不知道我做错了什么,以某种方式我在互联网上找不到任何能解决我问题的方法。也许有人可以提供帮助?

好的..那是因为我没有设置任何系列标签..以某种方式,这是图表不起作用的原因

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM