Create map of US state(South Carolina) and counties in SC with the help of Worldmap Panel, using SQL server datasource

Hi There,

I want to create a map of South Carolina with counties in it. I have county name, latitude and longitude fields available within the data. I am using MSSQL Server data source.

Thanks in advance,
Sony.

What have you tried to far? Can you include a screenshot of your query and the panel options?

Think everything should be documented here, have a look at table data section: https://grafana.com/plugins/grafana-worldmap-panel

Hi @mefraimsson,

Thank you for the response. I have created a WorldMap panel and the data source attached to it. I am using MSSQL, and when I inspect the query I am getting all values in response.

But on the world map panel, I am getting an error ‘Cannot read property ‘length’ of undefined’, please find below screenshot.

Thanks,
Sony.

Dear Sony,

can you also share a screenshot of your panel settings?

With kind regards,
Andreas.

Hi Andreas,

Thank you for the response, not sure whether I have missed any settings, please find below screenshot.

image

Thanks,
Sony.

Dear Sony,

there might be a hiccup. On the first screenshot, it says “Table format”, while the second one tells us something about “Timeseries data”. Both are different kinds of beasts and determine how data is queried and how it is flowing through Grafana. You will have to learn that first.

We have been able to ramp up our remote-hands skills on that topic recently. You might also follow these conversations where at some point it might also click for you.

Especially, we would like to point out the Quick summary about using the Worldmap Panel with timeseries data coming from InfluxDB. This might also clarify some things for you.

Good luck getting into this world!

With kind regards,
Andreas.

Maybe wrong here, but given you’ve selected table format in query and you select latitude and longitude you probably want to change Location Data config to table and then below Table Query Format as coordinates.

Then input your column names in each config field where applicable.

With my suggested config I don’t think you’ll need to select a time column in query.

Could you please provide code samples for the same, I am new to Grafana.

Thanks,
Sony.

Dear Sony,

what @mefraimsson is talking about here is that you are probably on the right track with using table format as you are having location information in your datasource itself (as opposed to timeseries format, where location information is coming from an out-of-band JSON).

While I do like code as well, I believe screenshots are better in this specific context.

Metrics

image

Worldmap panel settings

image
image

With kind regards,
Andreas.

Hi Andreas,

Thank you for the quick response. Could you please send the sample query also, it will help me to achieve the goal. I am using MSSQL server 2016, FYI.

Thanks,
sony.

Hi Andreas,

Thank you very much for your great help!!.

Now I am able to load the map.

Thanks once again.

Sony.

1 Like

Good to hear that you made it through.

Happy mapping!

All the best,
Andreas.