Page 1 of 1

I would like to inquire about how to apply a legend to a ColorGrid chart.

Posted: Fri Apr 12, 2024 12:34 am
by 17797791
I would like to inquire about how to apply a legend to a ColorGrid chart as shown in the attached image.
thank you.

Re: I would like to inquire about how to apply a legend to a ColorGrid chart.

Posted: Tue Apr 16, 2024 8:03 am
by yeray
Hello,

The simplest way could be adding a dummy Line series to draw those items in the legend.
Add the Line series before adding the ColorGrid:

Code: Select all

  var line = Chart1.addSeries(new Tee.Line());
  line.data.values = [1200, 1150, 1100, 1050, 1000, 950, 900];
  line.colorEach = "yes";
Tune the legend and the left axis:

Code: Select all

  Chart1.legend.legendStyle="values";
  Chart1.legend.symbol.height = 18;
  Chart1.legend.symbol.format.stroke.fill = "";
  Chart1.axes.left.setMinMax(0, 100);
Use the warm palette:

Code: Select all

Chart1.applyPalette("warm");
firefox_hi5roHNNQI.png
firefox_hi5roHNNQI.png (5.81 KiB) Viewed 1597 times
The alternative would be to draw the legend manually.