Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

r - How to get right Map for India in highcharts?

I am working on covid dataset and have mapped the data on Indian Map using highcharts but that Map is not latest & doesn't show all its States - for example Telengana which was formed ~7 years back is missing in the map.

Highchart Map link: https://code.highcharts.com/mapdata/countries/in/in-all

enter image description here

hcmap(
            "countries/in/in-all",
            data = (df_ind %>% filter(Date == max(Date, na.rm = TRUE),
                                      State.UnionTerritory != "India"
            )
            ),
            value = Daily_confirmed,
            joinBy = c("hc-a2"),
            datalabels = list(enabled = TRUE, format = "{point.name}"),
            borderColor = "#FAFAFA",
            borderWidth = 0.1,
            tooltip = list(
                # valueDecimals = 2,
                # valuePrefix = "$"
            )
        ) %>% 
            hc_colorAxis(minColor = "midnightblue", maxColor = "orange")

I did find another Map of India on highcharts containing State - Telengana but whenever I use that all the mapped data on it gets messed up:

https://code.highcharts.com/mapdata/ https://code.highcharts.com/mapdata/countries/in/custom/in-all-disputed.svg

"countries/in/custom/in-all-disputed"

enter image description here

If I use this link & check hc-a2 field then turns out that State Chandigarh & Chattisgarh have same CHvalue in hc-a2.

hc-a2  n
<chr>  <int>
    
AP  2           
CH  2           
DA  2           
MA  2           
PU  2   

Basically there are issues with the mapping data which I can change it now manually or may be re map it by using names but this will not be good for future use as I may need to change it everytime.

So is there a more consistent form of Map for India in highcharts that I can refer to ??

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...