Giter Site home page Giter Site logo

Comments (10)

Shestac92 avatar Shestac92 commented on July 23, 2024

@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);

The result:
pietooltip

from anychart-android.

aadesh0118 avatar aadesh0118 commented on July 23, 2024

So if i want to hide the "value "and "Percent value" and display only the title. Can i do that?

from anychart-android.

Shestac92 avatar Shestac92 commented on July 23, 2024

@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.

aadesh0118 avatar aadesh0118 commented on July 23, 2024

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.

Shestac92 avatar Shestac92 commented on July 23, 2024

@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.

aadesh0118 avatar aadesh0118 commented on July 23, 2024

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.

Shestac92 avatar Shestac92 commented on July 23, 2024

@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.

aadesh0118 avatar aadesh0118 commented on July 23, 2024

Yes only the value. Not frequency or Percent value or anything like that. Just a value.

from anychart-android.

Shestac92 avatar Shestac92 commented on July 23, 2024

@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);

The result:
pietooltip

from anychart-android.

aadesh0118 avatar aadesh0118 commented on July 23, 2024

Thanks. Thats all i wanted.

from anychart-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.