AnyChart / AnyChart-Android

AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
2.29k stars 369 forks source link

the problem in treemap #246

Closed jianning0925 closed 2 years ago

jianning0925 commented 2 years ago

Hi, In the treemap ,How to make the size of his area different from the color value . such as : data.add(new TreeMapChartActivity.CustomTreeDataEntry("Apples", "Fruits", "Apples", 50)); treeMap.colorScale().ranges(new String[]{ "{ less: 2 }", "{ from: 2, to: 5 }", "{ from: 5, to: 20 }", "{ from: 20, to: 50 }", "{ from: 50, to: 80 }", "{ greater: 80 }" });

but the color need to by other value.

For example, the country's population is size and the birth rate is color

Shestac92 commented 2 years ago

@jianning0925 You should add "size" field in the custom data entry. Then you can apply size and value (for color) separately.

jianning0925 commented 2 years ago

I see . the treeData value control the size, and the color range , if i add a new field , how to let the color use the new field?

Shestac92 commented 2 years ago

@jianning0925 The color depends on the "value" field only. The size depends on "size" if it persists or on "value". So, you need both in this case.

jianning0925 commented 2 years ago

ok ,Thank you for the answer