frappe/charts

Can we update format_tooltip_x and format_tooltip_y dynamically?

Open

#128 创建于 2018年3月2日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (769 fork)batch import
enhancementhacktoberfest

仓库指标

Star
 (14,858 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Expected Behaviour

Hey guys,

What do you think about changing format_tooltip_x and format_tooltip_y when you set new data like:

MyChart.update_values(datasets, labels);

It will be cool if we can use something like update_settings:

const unit = myUnit || 'foo';

MyChart.update_settings({
  colors: ['red', 'blue'],
  format_tooltip_x: d => `${d) ${unit}`,
  format_tooltip_y: d => `${d) ${unit}`,
  ...,
});

Here is a shot of what I can try to achieve: Image

When I click on requests I want to see XXX Requests then when I click on the Bandwidth I want to see XXX MB/GB/TB or something.

Actual Behaviour

We can update only the datasets and labels labels or maybe I'm missing something?

贡献者指南