Closed mprattinger closed 5 years ago
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
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 #87)TitleFontColor
: string
(mention color util)TitleSpacing
: double
-> 2
TitleMarginBottom
: double
-> 6
BodyFontFamily
: string
BodyFontSize
: double
-> 12
BodyFontStyle
: FontStyle
(string enum from #87)BodyFontColor
: string
(mention color util)BodySpacing
: double
-> 2
FooterFontFamily
: string
FooterFontSize
: double
-> 12
FooterFontStyle
: FontStyle
(string enum from #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 :)
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
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).
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?
Which charts is this question related to?
PieChart
Thanks in advance, r Michael