logseq-fenced-code-plus icon indicating copy to clipboard operation
logseq-fenced-code-plus copied to clipboard

echarts block render error

Open xu4wang opened this issue 2 years ago • 4 comments

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"
    }
  ]
}

xu4wang avatar Jul 26 '23 17:07 xu4wang

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"
    }
  ]
}

Bad3r avatar Jan 24 '24 20:01 Bad3r

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

xu4wang avatar Jan 26 '24 10:01 xu4wang

@xu4wang update to 0.0.9

Bad3r avatar Feb 16 '24 07:02 Bad3r

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.

FabianMNoss avatar Apr 17 '24 19:04 FabianMNoss