echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] candlestick barMaxWidth will not work when barWidth is set

Open SanLeen opened this issue 4 years ago • 2 comments

Version

5.3.0

Link to Minimal Reproduction

No response

Steps to Reproduce

  1. Candlestick chart width barMaxWidth

_scg10

  1. set barWidth: '80%', barMaxWidth not work

_scg11

Current Behavior

Candlestick chart barMaxWidth will not work when barWidth is set

Expected Behavior

barMaxWidth and barWidth work fine at Candlestick chart.

Environment

- OS: Windows 10 Pro 21H2
- Browser: Microsoft Edge 98.0.1108.43
- Framework: [email protected]

Any additional comments?

Echarts Editor Code

const data0 = splitData([
  ['2013/5/16', 2221.34, 2251.81, 2210.77, 2252.87],
  ['2013/5/17', 2249.81, 2282.87, 2248.41, 2288.09],
  ['2013/5/20', 2286.33, 2299.99, 2281.9, 2309.39],
  ['2013/5/21', 2297.11, 2305.11, 2290.12, 2305.3],
  ['2013/5/22', 2303.75, 2302.4, 2292.43, 2314.18],
  ['2013/5/23', 2293.81, 2275.67, 2274.1, 2304.95],
  ['2013/5/24', 2281.45, 2288.53, 2270.25, 2292.59],
  ['2013/5/27', 2286.66, 2293.08, 2283.94, 2301.7],
  ['2013/5/28', 2293.4, 2321.32, 2281.47, 2322.1],
  ['2013/5/29', 2323.54, 2324.02, 2321.17, 2334.33],
  ['2013/5/30', 2316.25, 2317.75, 2310.49, 2325.72],
  ['2013/5/31', 2320.74, 2300.59, 2299.37, 2325.53],
  ['2013/6/3', 2300.21, 2299.25, 2294.11, 2313.43],
  ['2013/6/4', 2297.1, 2272.42, 2264.76, 2297.1],
  ['2013/6/5', 2270.71, 2270.93, 2260.87, 2276.86],
  ['2013/6/6', 2264.43, 2242.11, 2240.07, 2266.69],
  ['2013/6/7', 2242.26, 2210.9, 2205.07, 2250.63],
  ['2013/6/13', 2190.1, 2148.35, 2126.22, 2190.1]
]);

function splitData(rawData: (number | string)[][]) {
  const categoryData = [];
  const values = [];
  for (var i = 0; i < rawData.length; i++) {
    categoryData.push(rawData[i].splice(0, 1)[0]);
    values.push(rawData[i]);
  }
  return { categoryData, values };
}

option = {
  grid: { left: '10%', right: '10%', bottom: '15%' },
  xAxis: {
    type: 'category',
    data: data0.categoryData,
    min: 'dataMin',
    max: 'dataMax'
  },
  yAxis: { scale: true },
  dataZoom: [{ type: 'inside', start: 50, end: 100 }],
  series: [
    {
      type: 'candlestick',
      data: data0.values,
      // barWidth: '80%', // 👈🤨
      barMaxWidth: 34
    }
  ]
};

SanLeen avatar Feb 16 '22 07:02 SanLeen

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Feb 16 '24 21:02 github-actions[bot]

🤔

SanLeen avatar Feb 16 '24 22:02 SanLeen