Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

导出 PDF 图表缺失 #1312

Closed
1469113877 opened this issue Oct 14, 2022 · 3 comments
Closed

导出 PDF 图表缺失 #1312

1469113877 opened this issue Oct 14, 2022 · 3 comments
Assignees
Milestone

Comments

@1469113877
Copy link

1469113877 commented Oct 14, 2022

下载为pdf预览,echart图表没有自适应

  • wysiwyg 所见即所得模式
  • ir 即时渲染模式
  • sv 分屏编辑预览模式

描述问题

1、下载为pdf图表缺失,在官网demo实例中导出也同样存在该问题,具体见图1、2、3
2、是否有提供调整整个echarts容器大小的入口,当我使用移动端预览时,图表被拉伸的过长,却不知道如何调整整个容器的大小,如图4

# 公交客流需求

> 日均公交客流量0.85万人次,环比下降17.91%

```echarts
{
    "color": [
        "#5470C6", 
        "#EE6666"
    ], 
    "tooltip": {
        "trigger": "none", 
        "axisPointer": {
            "type": "cross"
        }
    }, 
    "legend": { }, 
    "xAxis": [
        {
            "type": "category", 
            "axisTick": {
                "alignWithLabel": true
            }, 
            "axisLine": {
                "onZero": false, 
                "lineStyle": {
                    "color": "#EE6666"
                }
            }, 
            "data": [
                "2016-1", 
                "2016-2", 
                "2016-3", 
                "2016-4", 
                "2016-5"
            ]
        }, 
        {
            "type": "category", 
            "axisTick": {
                "alignWithLabel": true
            }, 
            "axisLine": {
                "onZero": false, 
                "lineStyle": {
                    "color": "#5470C6"
                }
            }, 
            "data": [
                "2015-1", 
                "2015-2", 
                "2015-3", 
                "2015-4", 
                "2015-5"
            ]
        }
    ], 
    "yAxis": [
        {
            "type": "value"
        }
    ], 
    "series": [
        {
            "name": "Precipitation(2015)", 
            "type": "line", 
            "xAxisIndex": 1, 
            "smooth": true, 
            "emphasis": {
                "focus": "series"
            }, 
            "data": [
                2.6, 
                5.9, 
                9, 
                26.4, 
                28.7
            ]
        }, 
        {
            "name": "Precipitation(2016)", 
            "type": "line", 
            "smooth": true, 
            "emphasis": {
                "focus": "series"
            }, 
            "data": [
                3.9, 
                5.9, 
                11.1, 
                18.7, 
                48.3
            ]
        }
    ]
}
```

> 公交出行率1.80%,环比上升12.50%

```echarts
{
    "backgroundColor": "#fafbfc", 
    "title": {
        "text": "Customized Pie", 
        "left": "center", 
        "top": 20, 
        "textStyle": {
            "color": "#586069"
        }
    }, 
    "tooltip": {
        "trigger": "item"
    }, 
    "visualMap": {
        "show": false, 
        "min": 80, 
        "max": 600, 
        "inRange": {
            "colorLightness": [
                0, 
                1
            ]
        }
    }, 
    "series": [
        {
            "name": "Access From", 
            "type": "pie", 
            "radius": "50%", 
            "center": [
                "50%", 
                "50%"
            ], 
            "data": [
                {
                    "value": 235, 
                    "name": "Video Ads"
                }, 
                {
                    "value": 274, 
                    "name": "Union Ads"
                }, 
                {
                    "value": 310, 
                    "name": "Email"
                }, 
                {
                    "value": 335, 
                    "name": "Direct"
                }, 
                {
                    "value": 400, 
                    "name": "Search Engine"
                }
            ], 
            "roseType": "radius", 
            "label": {
                "color": "rgba(33, 33, 33, 0.3)"
            }, 
            "labelLine": {
                "lineStyle": {
                    "color": "rgba(33, 33, 33, 0.3)"
                }, 
                "smooth": 0.2, 
                "length": 10, 
                "length2": 20
            }, 
            "itemStyle": {
                "color": "#c23531", 
                "shadowBlur": 200, 
                "shadowColor": "rgba(0, 0, 0, 0.3)"
            }, 
            "animationType": "scale", 
            "animationEasing": "elasticOut"
        }
    ]
}
```

> 热门OD TOP5

```echarts
{
    "title": {
        "text": "World Population"
    }, 
    "tooltip": {
        "trigger": "axis", 
        "axisPointer": {
            "type": "shadow"
        }
    }, 
    "legend": { }, 
    "grid": {
        "left": "3%", 
        "right": "4%", 
        "bottom": "3%", 
        "containLabel": true
    }, 
    "xAxis": {
        "type": "value", 
        "boundaryGap": [
            0, 
            0.01
        ]
    }, 
    "yAxis": {
        "type": "category", 
        "data": [
            "Brazil", 
            "Indonesia", 
            "USA", 
            "India", 
            "China", 
            "World"
        ]
    }, 
    "series": [
        {
            "name": "2011", 
            "type": "bar", 
            "data": [
                18203, 
                23489, 
                29034, 
                104970, 
                131744, 
                630230
            ]
        }, 
        {
            "name": "2012", 
            "type": "bar", 
            "data": [
                19325, 
                23438, 
                31000, 
                121594, 
                134141, 
                681807
            ]
        }
    ]
}
```

期待的结果

1、希望能根据导出尺寸自动调整,或者说能提供调整echarts容器大小的入口
2、并且缩放时,是否等比缩放更为合理,这样在切换移动端和PC端预览的时候,就不会出现横向过短导致如图4中标题和图例粘连的问题,纵向被拉伸过长影响美观

截屏或录像

image
image
image
image

版本信息

  • 版本:Vditor v3.8.15 / Lute v1.7.3
  • 操作系统:win11
  • 浏览器:chrome 106.0.5249.103(正式版本) (64 位)

其他信息

@Vanessa219
Copy link
Owner

我点击打印出来的和你的不太一样呀

image

@1469113877
Copy link
Author

我点击的是官网demo页中的导出为pdf功能,默认为A4大小,而且从您这边发的截图我似乎看不到有echarts相关图形,是否能发个有echarts的截图呢

@Vanessa219
Copy link
Owner

抱歉,我点成浏览器的打印了。。。

@Vanessa219 Vanessa219 changed the title 下载为pdf,echart图表无法自适应,导致下载图表缺失 导出 PDF 图表缺失 Oct 23, 2022
@Vanessa219 Vanessa219 self-assigned this Oct 23, 2022
@Vanessa219 Vanessa219 modified the milestones: 3.7, 3.8 Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants