AnyChart-Android
AnyChart-Android copied to clipboard
tooltip format round value
hello, please help me i have code like this L2.tooltip().format("function() {" +"return 'Payment : ' + anychart.format.number(this.value * "+divider+")" +"}"); this code produce tooltip below
how to make round from tooltip value and formating with group separator? so i can get output rounded integer value like below
"Total : 5.562" ">120 : 494" "91-120 : 207" "61-90 : 779" "31-60 : 1.843" "Sell out : 3.631" "Payment : 1.649"
@zeylevruntime For this purpose, you can use formatting parameters in a string token. Below is the snippet code:
Cartesian cartesian = AnyChart.area();
List<DataEntry> seriesData = new ArrayList<>();
seriesData.add(new ValueDataEntry("A", 51234.23412));
seriesData.add(new ValueDataEntry("B", 42342.242));
seriesData.add(new ValueDataEntry("C", 32343.243234));
seriesData.add(new ValueDataEntry("D", 4.42342));
final Area series1 = cartesian.area(seriesData);
cartesian.tooltip().format("{%value}{decimalsCount: 0, groupsSeparator:.}");
anyChartView.setChart(cartesian);
Below is the result:
oke, its work , thanks.. if you wish I ask another question? how to make area chart starting value from -(minus) like HiLo chart
@zeylevruntime Do you want to apply low and high values to the area? Make it a range-area?
this is example in excel,area chart starting value can be <0, how to make area chart like this?
@zeylevruntime The chart adjusts the yScale minimum automatically if the data includes negative values. Anyway, you can apply the yScale negative minimum manually. Like this:
chart.yScale().minimum(-2000);