@doogyb wrote:
Hi,
I’m running into some difficulty with Choropleth maps…
I’ve placed this component in my dash app:
dcc.Graph( figure=dict( data=[ go.Choropleth( geojson=county_geojson, locationmode="geojson-id", locations=counties.index, # Spatial coordinates z=counties.astype(int), # Data to be color-coded featureidkey="properties.name", ) ] ) )
Which returns the following:
However, if I use the exact same code as above and simply call fig.show(), the correct choropleth maps appears:
import plotly.graph_objects as go fig = go.Figure( data=go.Choropleth( geojson=county_geojson, locations=counties.index, # Spatial coordinates z=counties.astype(int), # Data to be color-coded featureidkey="properties.name", ) ) fig.update_geos(fitbounds="locations", visible=False) fig.show()
Any help with this would be greatly appreciated!
Thanks,
Sam
Posts: 2
Participants: 2