apexcharts / apexcharts.js

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

Candlestick Tooltip Customize #995

Closed ninjamonz closed 4 years ago

ninjamonz commented 4 years ago

Codepen

https://codepen.io/esdegan/pen/mddEqJj

Explanation

I don't know what happen, any clue or help? Thanks Q(^_^)Q

junedchhipa commented 4 years ago

The candlestick tooltip is customizable with the tooltip.custom function. Here is the example

tooltip: {
  custom: function({ seriesIndex, dataPointIndex, w }) {
    const o = w.globals.seriesCandleO[seriesIndex][dataPointIndex]
    const h = w.globals.seriesCandleH[seriesIndex][dataPointIndex]
    const l = w.globals.seriesCandleL[seriesIndex][dataPointIndex]
    const c = w.globals.seriesCandleC[seriesIndex][dataPointIndex]
    return (
      '<div class="apexcharts-tooltip-candlestick">' +
      '<div>Open: <span class="value">' +
      o +
      '</span></div>' +
      '<div>High: <span class="value">' +
      h +
      '</span></div>' +
      '<div>Low: <span class="value">' +
      l +
      '</span></div>' +
      '<div>Close: <span class="value">' +
      c +
      '</span></div>' +
      '</div>'
    )
  }
}
tolgaatrgt commented 3 years ago

Hey Juned, i couldnt manage it what is the up to date solution ? Thank you..

junedchhipa commented 3 years ago

@tolgaatrgt What have you tried?

tolgaatrgt commented 3 years ago

Sorry, my fault thanks !

Pablo-Yadav commented 5 months ago

thanks for sharing, it helped