Comments (10)
@aadesh0118
By the click on the chart, a default tooltip is appearing. In the current version of AnyChart Android library 0.2.0 you can't replace the tooltip with your own element. But you customize it very deeply (appearance, content, behaviour).
The code below changes the tooltip's appearance of a pie chart.
pieChart.getTooltip().setFontColor("orange");
pieChart.getTooltip().getTitle()
.setFontColor("lightgrey")
.setFontFamily("Calibri")
.setFontDecoration(Decoration.UNDERLINE)
.setFontWeight(400);
pieChart.getTooltip().getBackground()
.setFill("#663399 0.8")
.setStroke("green")
.setCornerType(BackgroundCornersType.ROUND_INNER)
.setCorners(5, 15, 5, 5);
from anychart-android.
So if i want to hide the "value "and "Percent value" and display only the title. Can i do that?
from anychart-android.
@aadesh0118
in this case you can disable body and separator like this:
pieChart.getTooltip().setTitle(false);
pieChart.getTooltip().setFormat("My title");
pieChart.getTooltip().getSeparator().setEnabled(false);
from anychart-android.
Thanks for you reply. This code does not seem to work when i implement in onclick.
What i am trying to do is display different values on click. Here is my code:
cloud.setOnClickListener(new ListenersInterface.OnClickListener(new String[]{"x", "value"}) {
@Override
public void onClick(Event event) {
Toast.makeText(MainActivity.this, event.getData().get("x") + ":" + event.getData().get("value"), Toast.LENGTH_SHORT).show();
//setmarker(event.getData().get("x"), event.getData().get("value"));
cloud.getTooltip().setTitle(false);
cloud.getTooltip().setFormat(event.getData().get("x"));
cloud.getTooltip().getSeparator().setEnabled(false);
}
});
In this case the the click has no effect.
from anychart-android.
@aadesh0118
Unfortunately, in the current version of the library, the onclik event setting may not work. We are working on a fix for this.
But you can achieve it with the following line:
cloud.getTooltip().setFormat("{%x} : {%value}");
from anychart-android.
Ah.. Thats a shame. What i was trying to do was to display just the value when on clicked. But apparently thats not possible eh..?
from anychart-android.
@aadesh0118
Do you mean that you want to show a tooltip only with a value by the click on a pie's slice?
from anychart-android.
Yes only the value. Not frequency or Percent value or anything like that. Just a value.
from anychart-android.
@aadesh0118
You can show only value in the tooltip by the click on pie's slice like this:
pie.getTooltip().setTitle(false);
pie.getTooltip().setFormat("{%value}");
pie.getTooltip().getSeparator().setEnabled(false);
from anychart-android.
Thanks. Thats all i wanted.
from anychart-android.
Related Issues (20)
- Documentation website is down HOT 1
- Feature request Dark Mode HOT 1
- Charts are not displaying HOT 8
- Android: Change background color of a chart HOT 2
- Build issue: Manifest merger failed with multiple errors
- Updating datasets for multiple charts in single view HOT 1
- Download it and run it, click on the page and nothing is displayed HOT 7
- Getting blank page when try to open any graph HOT 2
- Loading MutableLiveData HOT 1
- tree chart is showing on activity but not showing in fragment HOT 1
- Cannot resolve symbol 'AnyChartView' in Android Studio version Arctic Fox |2020.3.1 Patch 3 HOT 1
- Pie chart is flickering whenever new data is inserted HOT 1
- When I add chart, cant see anything in designer HOT 3
- Changing label color depending on data value
- Bar chart not showing when use more then one view.... HOT 2
- i have problem chart not displaying HOT 3
- Sponsored issue: Java to Kotlin HOT 1
- Vertical Bar data does not refresh when tried to update with new data set. HOT 2
- ็ดงๆฅๆฑๅฉ/Urgent assistance
- Is it possible to create a sleep stage graph in Android similar to Apple Health's visualization?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anychart-android.