xyhp915 / logseq-fenced-code-plus

A Logseq plugin for missing types of fenced code 🚀
MIT License
97 stars 13 forks source link

echarts block render error #29

Open xu4wang opened 11 months ago

xu4wang commented 11 months ago

Below is an example.

{
  "xAxis": {
    "type": "category",
    "data": [
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri",
      "Sat",
      "Sun"
    ]
  },
  "yAxis": {
    "type": "value"
  },
  "series": [
    {
      "data": [
        150,
        230,
        224,
        218,
        135,
        147,
        260
      ],
      "type": "line"
    }
  ]
}
Bad3r commented 5 months ago

The issue seems to be resolved. Please test again. Make sure to include echarts in the header i.e ```echarts image

{
  "xAxis": {
    "type": "category",
    "data": [
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri",
      "Sat",
      "Sun"
    ]
  },
  "yAxis": {
    "type": "value"
  },
  "series": [
    {
      "data": [
        150,
        230,
        224,
        218,
        135,
        147,
        260
      ],
      "type": "line"
    }
  ]
}
xu4wang commented 5 months ago

with version 0.0.7, it is not fixed on my logseq.

Bad3r commented 4 months ago

@xu4wang update to 0.0.9

FabianMNoss commented 2 months ago

I think I found some of the reason(s) that might also cause trouble to some - take a look at the first example from the official documentation:

option = {
  xAxis: {
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {},
  series: [
    {
      type: 'bar',
      data: [23, 24, 18, 25, 27, 28, 25]
    }
  ]
};

In Logseq the following cause issues:

  1. option = { must be removed, and so the ; at the very end
  2. All ' must be replaced with "
  3. All keywords must also be surrounded with "

This way it is working, but the examples must be modified at least.