Is it possible to create a custom legend on a bar graph?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
The legend description is automatic, but because I'm filtering the data - I want to put specific text in the legend to help the users understand what they are looking at. Is it possible to create your own legends?
Photo of Cameron Amigo

Cameron Amigo

  • 80 Points 75 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
I know you can change the colors, but I don't think you can change the text because it is based on the series you select. 

I'd recommend using a chart "description" and show that on the report.  
Descriptive axis labels help, and chart titles as well to tell the whole story.
Photo of Cameron Amigo

Cameron Amigo

  • 80 Points 75 badge 2x thumb
thanks Matt. I have that setup now but was hoping we could do a bit more because our graph trends are bit complex because we are comparing things that aren't similar. 
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,204 Points 20k badge 2x thumb
Using script you can modify a QuickBase rendered chart an change any options including the legend. Here are two examples that (1) changed the Yaxis and (2) change the data to cumulative:

The key to doing this is (1) to get a programmatic handle to the chart, (2) extract the current options, (3) destroy the current chart, (4) modify the original chart's options, and (5) redraw the chart with the new options:
var chart = Highcharts.charts[0];
var options = chart.options;
options.yAxis[0].min = 0;
options.yAxis[0].max = 80;
new Highcharts.Chart(options);
In the above examples I am animating the full process from a tasks table. However, if you embed a chart in a report the process can be made seamless so only the final chart appears.