Legend position in Vector Map


#1

I new here in the community and I am trying to use a Vector Map visualization in my dashboard. I made a quick search in the forum and I found this example How to apply color ranges to my vector map. I set the legend as you mention in the Legend documentation page. But I don’t like the legend in the bottom-right. How can I position it on the top-right?


#2

Hi @Adam , first at all welcome to the ChartFactor community. As a recommendation, you can explore all the documentation as the first step. There you can find anything you need to work with the ChartFactor Studio product. Answering your question you can change the legend position in a Vector Map using these values: right, left, top, bottom, top-right, top-left, bottom-right, bottom-left. Here you have the documentation link about that:

https://chartfactor.com/doc/latest/visualizations/maps/#legend


#3

Thanks @arturo . I’d also like to swap the values in the legend so that the highest value goes at the bottom and the lowest value at the top. Is it possible to do that?


#4

@Adam, absolutely, to do that you can create a Legend object and set the sort to reverse. For example: .set(“legend”, cf.Legend().position(‘top-right’).sort(‘reverse’)). This document covers the legend object in more detail.