apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.2k stars 19.61k forks source link

Is it possible to have multiple markers per candle in the candlestick chart. #9833

Closed azpublic closed 5 years ago

azpublic commented 5 years ago

General Questions

Issue Type

Issue Details

Is it possible to have multiple markers per candle in the candlestick chart. I have tried and if I have more than one marker for the same date , only one marker will be displayed. How can I have more than one ? Can you suggest any workaround such as overlaying arbitrary points on top of the candelstick chart with another series type?

Thank you.

Expected Behavior

have multiple markers for the same candle

Current Behavior

Only one marker per candle is allowed.

Online Example

var options = {

        animation: false,
        color: colorList,
        title: {
            left: 'center',
            text: 'candlestick chart'
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross'
            }
        },

        dataZoom: [
            {
                type: 'inside',
                start: 0,
                end: 100
            },
            {
                show: true,
                type: 'slider',
                y: '90%',
                start: 0,
                end: 100
            }
        ],

        xAxis: {
            data: dates,
            min: 'dataMin',
            max: 'dataMax',
            axisLabel: {
                formatter: function (value) {
                    let d = new Date(parseInt(value));
                    return (d.getUTCHours()+1)+"-"+d.getMinutes();
                }
            },

        },

        yAxis: {
            scale: true,
        },

        series: [

            {
                type: 'candlestick',
                name: 'candles',
                data: cndls,
                itemStyle: {
                    normal: {
                        color: '#58b1b0', 
                        color0: '#ef232a',
                        borderColor: '#133bb1',
                        borderColor0: '#ef232a',
                    },
                    emphasis: {
                        color: 'black',
                        color0: '#444',
                        borderColor: 'black',
                        borderColor0: '#444'
                    }
                },

                markPoint: {
                    data : trades,
                }
            },

            {
                type: 'line',
                name: 'ema',
                data: emaPoints,
            },

        ] //series
    };

Topics

Anything Else We Need to Know

N/A

Environment

100pah commented 5 years ago

I have no idea what is the content of the series.markPoint.data: trades in the option you provided. There is some other way to make markers or labels: Use scatter series but not show the graphics but only labels disable. Use custom series to make markers or labels.

echarts-bot[bot] commented 5 years ago

This issue is closed due to not being active. Please feel free to open it again (for the author) or create a new one and reference this (for others) if you have further questions.