Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Missing Tooltips in Option Class #89

Closed
mprattinger opened this issue Sep 17, 2019 · 4 comments · Fixed by #90
Closed

Missing Tooltips in Option Class #89

mprattinger opened this issue Sep 17, 2019 · 4 comments · Fixed by #90
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mprattinger
Copy link

Describe your question

First of all, this is an awsome library. Today i wanted to set the Tooltips options (i wanted to turn them off) and i realized, that this option is not in the PieOptions class for example or in the base class. I was wondering if this is as it should be?

Which Blazor project type is your question related to?

  • Server-Side

Which charts is this question related to?

PieChart

Thanks in advance,
r Michael

@mprattinger mprattinger added the question Further information is requested label Sep 17, 2019
@SeppPenner
Copy link
Contributor

SeppPenner commented Sep 18, 2019

You're right. It seems that we don't have tooltips configuration options at all yet: https://www.chartjs.org/docs/latest/configuration/tooltip.html

@Joelius300
Copy link
Owner

Thanks for contacting us, I'm glad you like the library :)

The tooltips do exist but are very limited currently. The file is here and as you can see, there's a TODO: Expand at the top.
The tooltips can be configured for BubbleOptions and LineOptions but as far as I understand the docs, every options-class should contain this. This means it should be a property Tooltips in BaseConfigOptions instead of in the individual options.

Because the tooltips have so many options to customize including many callbacks, we can't support it fully right now (we need a good general solution for parameterized callbacks which we have not determined yet).

I think the following options should be included in the Tooltips-class (for now):

Format:
Name : type -> default value (if value type, otherwise always null) + remarks

  • Enabled : bool -> true
  • Mode : InteractionMode (already done)
  • Intersect : bool -> true (already done)
  • Position : TooltipPosition (new string enum)
  • BackgroundColor : string (mention color util)
  • TitleFontFamily : string
  • TitleFontSize : double -> 12
  • TitleFontStyle : FontStyle (string enum from Implemented all special enums. #87)
  • TitleFontColor : string (mention color util)
  • TitleSpacing : double -> 2
  • TitleMarginBottom : double -> 6
  • BodyFontFamily : string
  • BodyFontSize : double -> 12
  • BodyFontStyle : FontStyle (string enum from Implemented all special enums. #87)
  • BodyFontColor : string (mention color util)
  • BodySpacing : double -> 2
  • FooterFontFamily : string
  • FooterFontSize : double -> 12
  • FooterFontStyle : FontStyle (string enum from Implemented all special enums. #87)
  • FooterFontColor : string (mention color util)
  • FooterSpacing : double -> 2
  • FooterMarginTop : double -> 6
  • XPadding : double -> 6
  • YPadding : double -> 6
  • CaretPadding : double -> 2
  • CaretSize : double -> 5
  • CornerRadius : double -> 6
  • MultiKeyBackground : string (mention color util)
  • DisplayColors : bool -> true
  • BorderColor : string (mention color util)
  • BorderWidth : double -> 0

The TooltipPosition-enum has two values average and nearest as seen here.

Summaries are to be taken from the latest docs-page and adjusted according to our conventions (i.e. Gets or sets..).

In chart.js 2.9 we'll have to add the following options:

  • TitleAlign : TooltipAlignment (new string enum)
  • BodyAlign : TooltipAlignment (new string enum)
  • FooterAlign : TooltipAlignment (new string enum)

Options will be left, right and center as you can see in the github docs-file. I found that but we don't need to worry about it right now, we just support 2.8 for now.

I can do these changes and include them in the next release but I'll be away for a while soon so you'd have to wait a bit until I get time. If you want to implement it yourself, please tell us (so noone else wastes time doing the same thing) and take a look at our contributing guidelines, our styling guidelines (here and here (this two will be merged in a single document soon)), the current implementation of string-enums (they are in this folder and you should also look at #87) and previous pull request from other contributors. This should help you do it correctly so we don't waste time adjusting things :)
Again, I don't have a lot of time currently and am going away for a while so you have to wait a bit for this to make it into a new nuget-release :)

@Joelius300 Joelius300 added enhancement New feature or request and removed question Further information is requested labels Sep 18, 2019
@Joelius300 Joelius300 added the good first issue Good for newcomers label Sep 18, 2019
@TomaszGrzmilas
Copy link
Contributor

Hi,

Can I handle this issue ? It will be my first contribution so I don't promise that everything will be done right away :)

BR

@Joelius300
Copy link
Owner

Go for it :)

Just make sure you take a look at the things I mentioned in the last comment here and you should be good. I'll review it once I get time (currently in vacation).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
4 participants