You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by João Rodrigues <jo...@gmail.com> on 2022/07/06 11:35:59 UTC

How to handle errors?

I need a way to handle invalid data.

option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
*      data: [150, 230, 224, 218, 135, 147, 260],*
*      type: 'radar'*
    }
  ]
};


For example, the radar chart does not work with an varray of numbers as
data. I want my app to tell me on runtime that the data is invalid. How
should I do this?

Thanks

Re: How to handle errors?

Posted by Ovilia <ov...@gmail.com>.
Hi,

You need a "radar" option. Please follow the example at
https://echarts.apache.org/examples/zh/editor.html?c=radar

Thanks

*Ovilia*


On Thu, Jul 7, 2022 at 5:05 AM João Rodrigues <jo...@gmail.com> wrote:

> I need a way to handle invalid data.
>
> option = {
>   xAxis: {
>     type: 'category',
>     data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
>   },
>   yAxis: {
>     type: 'value'
>   },
>   series: [
>     {
> *      data: [150, 230, 224, 218, 135, 147, 260],*
> *      type: 'radar'*
>     }
>   ]
> };
>
>
> For example, the radar chart does not work with an varray of numbers as
> data. I want my app to tell me on runtime that the data is invalid. How
> should I do this?
>
> Thanks
>