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

Feature: custom crosshair labels formatter #305

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

dan12411
Copy link
Contributor

@dan12411 dan12411 commented Jul 25, 2024

Description

Current crosshair labels' format is followed by scale's formatter. The PR is try to give custom formatter for crosshair labels.

At first, fix the label value.(should denormalize value before invert) - 6a8b10a

And Then add the formatter property - 326511c

For example,

Original format

original_format

Custom format

                   crosshair: CrosshairGuide(
                     ...
                     formatter: [
                       (date) => DateFormat('MM/dd').format(DateTime.parse(date as String)),
                       (volume) => (volume as num).toStringAsFixed(0),
                     ],
                   ),

custom_format

@dan12411 dan12411 force-pushed the change/format_crosshair_labels branch from 6ea8173 to 326511c Compare July 25, 2024 08:44
@entronad entronad merged commit 44fbd01 into entronad:main Jul 26, 2024
1 check passed
@dan12411 dan12411 deleted the change/format_crosshair_labels branch July 26, 2024 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants