How to define a custom on_hover behavior for a BarChart - is it really needed to re-implement all of PlotItem?

未关闭
#106 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust
领域
frontend

调研方向

先阅读 BarChart 的悬停处理和 content_formatter 路径,然后检查私有 items 模块中的 PlotItem 和无法访问的 PlotItemBase。定义一个可读的悬停 Box 所需的公共扩展点,并在可用的情况下通过现有的绘图示例或测试验证其行为。

由索引模型根据 Issue 内容生成。

描述

Currently it only seems possible to provide a custom String to content_formatter to change
what is written when hovering over a bar. But depending on the graph this is often not very well readable.

I'd much rather display a small Box similar to the legend to give more info about the current Bar in the BarChart.

I'm kind of pulling my hair out on this one and have not found a proper solution.

EDIT: A special problem seems to be that I cannot even re-implement PlotItem because for base and mut_base methods to be implemented, I need to use the Type PlotItemBase whcih is inaccesible as the items module is private. I am really stuck here :(
And that is even more frustrating because they are just returning the same as the original implementation anyway. I don't want to do anything special there...

主要语言
Rust
星标
494
派生
110
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

emilk/egui_plot 的其他 Issue

查看 emilk/egui_plot 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。