API-Manager icon indicating copy to clipboard operation
API-Manager copied to clipboard

In Summary By Partial Function bar graph

Open simonredfern opened this issue 8 years ago • 2 comments
trafficstars

... clicking on the name of partial function should take the user back to the list view and only show the calls to that partial function (with other search criteria still there).

This would allow us to see the details related to that call e.g. response codes etc.

simonredfern avatar Oct 23 '17 08:10 simonredfern

Alas, http://www.chartjs.org/ does not allow for links in labels. Somebody at https://stackoverflow.com/questions/23631170/html-in-chart-js-labels pointed out that (older versions of) ChartJS uses SVG's fillText which outputs text verbatim. Maybe they could implement links, but that looks clunky to me in SVG: https://www.w3.org/wiki/SVG_Links . Maybe it is possible to modify the rendered SVG via some sort of DOM, but my browser does not show the elements after the SVG has been rendered.

Using another tool for drawing bar charts might do it, e.g. D3. But that is considerably more difficult to use than ChartJS for a 'simple' chart. I also do not know yet if D3 would be up to the task.

Then i tried to have empty labels in the chart and added HTML 'labels' positioned meticulously to appear in front of the bar. This positioning falls apart for different numbers of partial functions when using static margins in CSS. We would need some formula to calculate the values dynamically via JS. Also, responsiveness went over board, maybe fixable via JS. Meh ...

Maybe we need to think about the layout differently. We could draw one SVG bar chart for each partial function (without label) and have an HTML label with the link underneath each of them. This way we would have the bars still close together for comparison in size and have the links close to the corresponding bar.

Or maybe we ditch SVG / ChartJS altogether and draw using HTML only? We would lose a few special effects, but maybe we do not need all that eye-candy?

What do you reckon @simonredfern ?

sebtesobe avatar Oct 24 '17 09:10 sebtesobe

I think more navigation functionality is better than eye candy - but not high prioirty right now.

simonredfern avatar May 16 '18 20:05 simonredfern