Giter Site home page Giter Site logo

Comments (12)

Shestac92 avatar Shestac92 commented on July 23, 2024

@fightaadeshfight
Can you elaborate, please, how do you want to apply colors and font? According which value/condition? Many options available here.

from anychart-android.

fightaadeshfight avatar fightaadeshfight commented on July 23, 2024

Like right now the text is picking random colors. I wanted to create my own set of colors which will be picked at random(there is no condition for it). I just want different shades.

For font i just want a different font for the complete chart.(Again, no conditions applied.)

from anychart-android.

Shestac92 avatar Shestac92 commented on July 23, 2024

@fightaadeshfight
You can define your own custom palette and the tag cloud will take colours from that palette.
You can implement it like this:

OrdinalColor ordinalColor = new OrdinalColor();
ordinalColor.setColors(new String[] { "#000000", "#f18126", "#3b8ad8", "#00ff00", "#ff0000" });
tagCloud.setColorScale(ordinalColor);

Font you can apply like this:

TagCloud.getNormal().setFontFamily("Helvetica");
tagCloud.getNormal().setFontSize(8);
tagCloud.getSelected().setFontStyle(TextFontStyle.ITALIC);

from anychart-android.

fightaadeshfight avatar fightaadeshfight commented on July 23, 2024

Can i add my custom font family(like in the form of ttf or otf file in android) or i can only choose from the ones already defined?

from anychart-android.

Shestac92 avatar Shestac92 commented on July 23, 2024

@fightaadeshfight
Yes! Now it's possible.
You can do it like this:

anyChartView.addFont("Pacifico", "file:///android_asset/Pacifico.ttf");
tagCloud.getNormal().setFontFamily("Pacifico");

And the Pacifico.ttf file should be located in assets.

We have just updated the library to implement this feature. Please, download the latest version to enable this feature.

from anychart-android.

fightaadeshfight avatar fightaadeshfight commented on July 23, 2024

Do i need to download the jar file? The new dependency does not seem to work

from anychart-android.

Shestac92 avatar Shestac92 commented on July 23, 2024

@fightaadeshfight
Can you specify how you include dependencies? With Gradle or any other tool?

from anychart-android.

fightaadeshfight avatar fightaadeshfight commented on July 23, 2024

with gradle. The old dependency
compile 'com.github.AnyChart:AnyChart-Android:0.1.9'

is working fine.

But when i change it to new version it stops working.

from anychart-android.

Shestac92 avatar Shestac92 commented on July 23, 2024

@fightaadeshfight
ok, I see. Can you share with us the error log by Gradle?

from anychart-android.

fightaadeshfight avatar fightaadeshfight commented on July 23, 2024

its working now. it wasn't a few hours earlier. maybe the mirrors were not updated or something. Thanks anyways.

from anychart-android.

fightaadeshfight avatar fightaadeshfight commented on July 23, 2024

I gave the ordinal colors as you said

 OrdinalColor ordinalColor = new OrdinalColor();
    ordinalColor.setColors(new String[] { "#3A3042", "#DB9D47", "#FF784F", "#5BC0EB", "#3C91E6", "#325060", "#6E8898", "#9FB1BC", "#E6EDE9", "#E2C044"});
   
 
    cloud.setColorScale(ordinalColor);

But it picks a 4 colors for the big words. rest are same. Is there a limit to colors that i can give? And if the items in the list is around 10 only one color is shown.

from anychart-android.

fightaadeshfight avatar fightaadeshfight commented on July 23, 2024

I figure it out. The colors were distributed according to category. So if i do not define any category the colors get distributed via range. So, i defined an array of categories and added them at random and hence the colors were chosen at random.

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.