Adding ColorBar

Dears, I have generated the plot as in figure with satellite data.
Is it possible to insert the colorbar?

Eventually, in which way would be possible to insert an external jped/png and define the path of picture/photo?

Hi there,

By “colorbar” do you mean a legend, or key, such as the image below?

image

Exactly. The values and the scale are referred to the max and min values from my data. I can generate a picture of the color scale but not clear how to insert in Cesium. Is there a different strategy or the possibility to generate the color scale?
Thank you for your interest and answer.

Thanks!

Generally I would recommend adding images like this directly to the DOM in the HTML of the page, and positioning with CSS. I don’t think adding the image to the Cesium view itself is necessary. CesiumJS does not contain APIs for generating color scales but there are many JS libraries that do, such as chroma.js.

Dear Gabby thank you for the answer.
I am trying to reproduce this example:
Cesium Sandcastle

Since the figure of color bar is generated by my processor and located in a folder of my pc, how can I load my jpeg on the html? which path?

Thank you
Kind Regards
Alessandro

Since the figure of color bar is generated by my processor and located in a folder of my pc, how can I load my jpeg on the html? which path?

For security reasons, browsers commonly treat requests to load resources directly from the file system (using the file:// schema) as cross-origin requests which can cause errors. We recommended that you set up a local server to load files in an app. Here’s one example of how that can be done.