Skip to content

markline组件自定义起点图标symbolOffset无效果 #4771

@HydeSong

Description

@HydeSong

One-line summary [问题简述]

  • markline组件自定义起点图标symbolOffset无效果
  • markline组件x,y设置后显示有问题
  • 文字只能显示在自定义图标的下方,所以我用了透明的图片,但效果还是不好
  • 设置起点终点的Y值后,很奇怪的是小的值显示在上方,大的值反而显示在底部
    这是网页的显示效果
    wx20161223-124252

Version & Environment [版本及环境]

  • 3.3.2 [ECharts 版本]:
  • Chrome [浏览器类型和版本]:
  • MacOS Sierra [操作系统类型和版本]:

Expected behaviour [期望结果]

wx20161223-124121

ECharts option [ECharts配置项]

option = {
        grid: [{
            left: '3%',
            bottom: '0%',
            width: '94%',
            height: '85%',
            containLabel: true
        }],
        xAxis: [{
            type: 'category',
            axisLine: {
                show: true,
                onZero: true,
                lineStyle: {
                    color: '#dadada',
                    width: 2,
                    type: 'solid'
                }
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                show: false
            },
            splitLine: {
                show: false
            },
            boundaryGap: ['10%', '10%'],
            data: []
        }],
        yAxis: [{
            type: 'value',
            position: 'left',
            scale: true,
            axisLine: {
                show: false,
                onZero: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                show: true,
                textStyle: {
                    color: '#050505',
                    fontSize: 10
                },
                formatter: '{value}'
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#dadada'
                }
            },
            max: 300,
            min: 0,
            interval: 150
        }],
        series: [{
            type: 'bar',
            yAxisIndex: 0,
            barMaxWidth: 30,
            data: [],
            markLine: {
                symbol: 'circle',
                label: {
                    normal: {
                        show: true,
                        position: 'start',
                        textStyle: {
                            color: '#050505',
                            fontSize: 12
                        }
                    }
                },
                lineStyle: {
                    normal: {
                        color: '#050505',
                        type: 'solid',
                        width: 0.5
                    },
                    emphasis: {
                        color: '#050505',
                        type: 'solid',
                        width: 0.5
                    }
                },
                data: []
            }
        }]
    };

从后台拉取数据后更新option

pointChart.setOption({
                        xAxis: [{
                            data: timeData
                        }],
                        yAxis: [{
                            max: maxPoint,
                            min: 0,
                            interval: maxPoint / 2
                        }],
                        series: [{
                            data: effortPoint,
                            markLine: {
                                data: [
                                    [{
                                        value: rs.days[0].target_point,//ajax获取的某值
                                        name: '指定值',
                                        symbol: 'image://./app_images/tag2.png',
                                        symbolSize: [24, 43.5],
                                        symbolOffset: [-20, 0],//此处设置后没有效果
                                        x: '10%',
                                        y: rs.days[0].target_point//ajax获取的某值
                                    },
                                        {
                                            name: '指定值',
                                            symbolSize: [0, 0],
                                            x: '97%',
                                            y: rs.days[0].target_point//ajax获取的某值
                                        }]
                                ]
                            }
                        }]
                    });

Other comments [其他信息]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions