Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip not showing on timeseries with multiple x axis and type candlestick #2434

Closed
gc-sommer opened this issue Nov 24, 2021 · 2 comments
Closed
Assignees
Labels

Comments

@gc-sommer
Copy link

gc-sommer commented Nov 24, 2021

Hi!

Thanks for your efforts on billboard.js - I'm migrating from c3.js and it has been a pleasure so far!

Description

When a second x axis is defined the tooltip won't show up on mouse over a candlestick item when axis type 'timeseries' and a second x axis is used. In the demo the step chart works as expected, while mouse over candlestick do not.

Steps to check or reproduce

Adjusted from https://naver.github.io/billboard.js/demo/#Chart.CandlestickChart:

// base css
import 'billboard.js/dist/theme/insight.css';
import bb from 'billboard.js';

var chart2 = bb.generate({
  data: {
    xs: { data1: 'x', data2: 'x2' },
    columns: [
      ['x', '2021-02-20', '2021-02-21'],
      ['x2', '2021-02-24', '2021-02-27'],
      [
        'data1',
        { open: 1300, high: 1369, low: 1200, close: 1339, volume: 100 },
        { open: 1348, high: 1371, low: 1271, close: 1320 },
      ],
      ['data2', 1234, 1111],
    ],
    types: {
      data1: 'candlestick', // for ESM specify as: candlestick()
      data2: 'step', // for ESM specify as: candlestick()
    },
    labels: true,
  },
  candlestick: {
    width: {
      data1: 30,
      data2: 70,
    },
    color: {
      down: {
        data1: 'red',
        data2: 'cyan',
      },
    },
  },
  axis: {
    x: {
      type: 'timeseries',
      tick: {
        format: '%Y-%m-%d',
      },
      padding: {
        left: 43200000,
        right: 43200000,
      },
    },
  },
  bindto: '#candlestickChart_2',
});
@netil netil added the bug label Nov 25, 2021
@netil
Copy link
Member

netil commented Nov 25, 2021

Hi @gc-sommer, thanks for report! I'll check the issue.

netil added a commit to netil/billboard.js that referenced this issue Nov 25, 2021
- Make handling candlestick type shape in .findClosest()
- Move .isWithinBar() from bar.ts -> shape.ts

Ref naver#2434
@netil netil self-assigned this Nov 25, 2021
@netil netil closed this as completed in 0278067 Nov 25, 2021
@gc-sommer
Copy link
Author

Thank you very much for the timely solution @netil !

github-actions bot pushed a commit that referenced this issue Dec 17, 2021
# [3.3.0-next.1](3.2.2...3.3.0-next.1) (2021-12-17)

### Bug Fixes

* **text:** Fix text position with candlestick type combination ([f84ab3e](f84ab3e)), closes [#2436](#2436)
* **tooltip:** fix candlestick tooltip display with xs option ([0278067](0278067)), closes [#2434](#2434)

### Features

* **bar:** add non zero based bar chart ([3588abe](3588abe)), closes [#2408](#2408) [#2438](#2438)
* **bar:** Implement stacking bar radius ([8f14d1a](8f14d1a)), closes [#2428](#2428)
* **module:** Support dual CJS/ESM package ([437c007](437c007)), closes [#2202](#2202)
* **option:** Enhance padding to be removed completely ([2052a19](2052a19)), closes [#2367](#2367)
* **plugin:** Intent to ship TableView plugin ([215b611](215b611)), closes [#1873](#1873)
github-actions bot pushed a commit that referenced this issue Jan 14, 2022
# [3.3.0](3.2.2...3.3.0) (2022-01-14)

### Bug Fixes

* **api:** Ensure svg nodes to be removed from memory  ([f49ed83](f49ed83)), closes [#2489](#2489)
* **event:** fix touch event handling on arc ([d3d2e05](d3d2e05)), closes [#2477](#2477)
* **text:** Fix text position with candlestick type combination ([f84ab3e](f84ab3e)), closes [#2436](#2436)
* **tooltip:** fix candlestick tooltip display with xs option ([0278067](0278067)), closes [#2434](#2434)
* **types:** Fix axis types definition ([92fb033](92fb033)), closes [#2499](#2499)
* **types:** Fix plugin's type definition ([f3690f9](f3690f9)), closes [#2483](#2483)

### Features

* **axis:** alow user to hide tick lines while using culling ([aad8c45](aad8c45)), closes [#2478](#2478) [#2480](#2480)
* **bar:** add non zero based bar chart ([3588abe](3588abe)), closes [#2408](#2408) [#2438](#2438)
* **bar:** Implement stacking bar radius ([8f14d1a](8f14d1a)), closes [#2428](#2428)
* **bar:** Intent to ship bar.indices.removeNull ([b16605d](b16605d)), closes [#1687](#1687)
* **option:** Enhance padding to be removed completely ([2052a19](2052a19)), closes [#2367](#2367)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants