tiddly-gittly / tw-echarts

An All-in-one Visualization Framework for TiddlyWiki5 based on ECharts
https://tiddly-gittly.github.io/tw-echarts/
MIT License
48 stars 8 forks source link

Some of the example echarts not working #41

Open arunnbabu81 opened 2 years ago

arunnbabu81 commented 2 years ago

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 ?

linonetwo commented 2 years ago

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

arunnbabu81 commented 2 years ago

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

Gk0Wk commented 2 years ago

@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👀.