tw-echarts icon indicating copy to clipboard operation
tw-echarts copied to clipboard

Some of the example echarts not working

Open arunnbabu81 opened this issue 2 years ago • 3 comments

I tried these example echarts from this site -https://echarts.apache.org/examples/en/index.html

  1. https://echarts.apache.org/examples/en/editor.html?c=calendar-pie
  2. https://echarts.apache.org/examples/en/editor.html?c=bar-race-country
  3. https://echarts.apache.org/examples/en/editor.html?c=bar-label-rotation

These three were not working. But many other examples were working in my wiki.

Any suggestions ?

arunnbabu81 avatar Apr 28 '22 18:04 arunnbabu81

What's the differences between them? Usage of JS?

linonetwo avatar May 01 '22 02:05 linonetwo

I don't know what the difference between them. Just noticed that they were not working

arunnbabu81 avatar May 02 '22 08:05 arunnbabu81

@arunnbabu81 Well, the answer is simple: the [Edit Code] section is not necessarily the most complete code, the [Full Code] section is - for example, in the first example, if you copy the [Code Edit] section directly, you will get an error app is not defined, if you go to the [ Full Code] you will find that you should actually add a line const app={}; at the top.

So is it possible to just copy [Full Code]? The answer is no, that would also be an error.

So my advice is that you should start with simple examples and learn some JavaScript syntax - or, you can bring confusing examples to Discussions👀.

Gk0Wk avatar May 03 '22 09:05 Gk0Wk