AnyChart-Android icon indicating copy to clipboard operation
AnyChart-Android copied to clipboard

using own variable in tooltip

Open saptarshidash opened this issue 5 years ago • 5 comments

How can i add my own variables in the tooltip , suppose i have declared a variable cost and i want to add this in tooltip

saptarshidash avatar Mar 29 '20 21:03 saptarshidash

@saptarshidash You can apply any variable to the tooltip content string:

var myValue = 100;
series.tooltip().format("Series: " + myValue);

Or using string tokens you can apply any field value from your data:

series.tooltip().format("Series: {%value}");

Shestac92 avatar Mar 30 '20 09:03 Shestac92

another question sir , kindly please describe how to properly configure the unboundregion while using the choropleth map in Android , already gone through the documentation , still im not able to do it

saptarshidash avatar Mar 30 '20 12:03 saptarshidash

@saptarshidash Please, can you specify the settings or the desired visual appearance of unbound regions and I will check the possibility?

Shestac92 avatar Mar 31 '20 07:03 Shestac92

    data.add(new CustomDataEntry("IN.SK", "", new LabelDataEntry(false)));
    data.add(new CustomDataEntry("IN.TN", "Tamil Nadu", regionalHashMap.tamilnadu.get("cnf"),regionalHashMap.tamilnadu.get("dischg"),regionalHashMap.tamilnadu.get("death")));
    data.add(new CustomDataEntry("IN.TR", "", new LabelDataEntry(true)));

i want to set the unbound region to this datas which are set to false , with a green color ,

and sir , im trying to set the ordinal color range for the map, please also specify the syntax for java android for the same with a example. im trying this way OrdinalColor ordinalColor=OrdinalColor.instantiate(); ordinalColor.colors(new String[]{"#e1f5fe", "#81d4fa", "#29b6f6", "#039be5","#01579b"}); ordinalColor.ranges(new String[]{"from 10 to 30"}); but not working

saptarshidash avatar Apr 01 '20 18:04 saptarshidash

@saptarshidash Both options are available! Check the snippet below:

        OrdinalColor ordinalColor = OrdinalColor.instantiate();
        ordinalColor.colors(new String[]{"#e1f5fe", "#81d4fa", "#29b6f6", "#039be5","#01579b"});
        ordinalColor.ranges(new String[]{"{from: 0, to: 5}", "{from: 5, to: 10}"});
        series.colorScale(ordinalColor);
        map.colorRange("{orientation: 'bottom'}");

        map.unboundRegions("{stroke: '2 #F44336', fill: '#00ff00 0.4'}"); // 2 - stroke thickness, 0.4 - fill opacity

Below is the result and the full code: Screenshot 2020-04-06 at 12 56 46

Shestac92 avatar Apr 06 '20 04:04 Shestac92