Joelius300 / ChartJSBlazor

This library is a modification of the awesome ChartJs.Blazor library by mariusmuntean. It's supposed to add more functionality to the LineChart and generally make the library more complete.
Other
40 stars 6 forks source link

Missing Tooltips in Option Class #89

Closed mprattinger closed 5 years ago

mprattinger commented 5 years ago

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

SeppPenner commented 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

Joelius300 commented 5 years ago

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

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:

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 :)

TomaszGrzmilas commented 5 years ago

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 commented 5 years ago

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).