marcusolsson / grafana-gantt-panel

A panel plugin for Grafana to visualize Gantt charts.
Apache License 2.0
26 stars 12 forks source link

Configure label fields and size #47

Closed felixmondelo closed 2 years ago

felixmondelo commented 3 years ago

Current label is too big for many scenarios, It would be great if we can decide which fields must appear un the label and size of the label.

marcusolsson commented 3 years ago

Could you give an (anonymized) example? How many labels are we talking about?

marcusolsson commented 3 years ago

Oh, sorry! I remember our earlier conversation now.

felixmondelo commented 3 years ago

Just to give more options, current we have:

image

I only need that the first 4 lines disappear:

image

It would be great if only contextual data appears on the label:

image

felixmondelo commented 3 years ago

Hi @marcusolsson,

We have modified the code that works for us. We modify the file:

https://github.com/marcusolsson/grafana-gantt-panel/blob/main/src/GanttChart.tsx

And remove from the const tooltipContent the following lines (320 to 329):

            <div className={styles.tooltip.header}>{label}</div>
            {startTimeValue && (
              <div className={styles.tooltip.value}>Started at: {startField.display!(startTimeValue).text}</div>
            )}
            {endTimeValue && (
              <div className={styles.tooltip.value}>Ended at: {endField.display!(endTimeValue).text}</div>
            )}
            <div className={styles.tooltip.faint}>
              {humanizeDuration((endTimeValue || Date.now()) - startTimeValue, { largest: 2 })}
            </div>

This solution is valid for us, maybe if there is an option in the plugin to enable/disable this headers, can be a good solution. What is your opinion?

marcusolsson commented 3 years ago

I think it should be configurable. Not sure what to call the option though.

felixmondelo commented 3 years ago

Show tootltip header sounds great!

felixmondelo commented 3 years ago

Hi @marcusolsson I have developed the solution, I attach the modified files from the Master to modify your code and add the possibility to show/hide the header. showTooltipHeader.zip

felixmondelo commented 2 years ago

Hi @marcusolsson,

In my previous comment I sent the code, do you prefer that I merge it? or can you modify it?

Thanks and regards.

marcusolsson commented 2 years ago

I've decided to move feature requests to GitHub Discussions. In contrast to bug reports, many feature requests turn into open-ended discussions as it can sometimes be difficult to determine whether a feature is worth implementing. This leads to an increasing number of issues, many which may not be worked on any time soon.

To improve the signal-to-noise ratio among issues, I'm therefore moving all feature requests to the Ideas category under GitHub Discussions. Only when someone's started working on a feature, an actual issue will be created for the feature.

I'll admit that this won't necessarily improve response times, or even guarantee a timely response. Hopefully though, it'll give me a chance to actually clear out issues. Thank you for your patience! 🙏