apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.34k stars 1.3k forks source link

yaxis reversed:true doesn't work on candlestick #4746

Open terion-name opened 2 weeks ago

terion-name commented 2 weeks ago

Description

var options = {
    chart: {
      height: 300,
      type: 'candlestick'
    },
    tooltip: {
      enabled: true
    },
    yaxis: {
      show: true,
      tooltip: {
        enabled: true
      },
      reversed: true   
  },
  series: [{
    name: 'positions',
    data: [
      { x: 'Mon', y: [9, 7, 10, 8] },
      { x: 'Tue', y: [8, 6, 9, 7] },
      { x: 'Wed', y: [7, 5, 8, 6] },
      { x: 'Thu', y: [6, 4, 7, 5] },
      { x: 'Fri', y: [5, 3, 6, 4] },
      { x: 'Sat', y: [4, 2, 5, 3] },
      { x: 'Sun', y: [3, 1, 4, 2] }
    ]
  }]
};

Expected Behavior

Values on Y axis are reversed

Actual Behavior

They are not

Screenshots

Screenshot 2024-10-04 at 23 06 55

Reproduction Link

https://codepen.io/terion/pen/NWQrKbx

rosco54 commented 1 week ago

After a quick check of the code that feature is not implemented for candlestick (or box) charts.

PS. The data format in your example and codepen is incorrect. You appear to have OLHC rather than OHLC values, which is causing the maximum Y value to be too small and clipping your candlesticks at the start of the week.