Skip to content

Instantly share code, notes, and snippets.

View Shestac92's full-sized avatar
🏠
Working from home

Alexander Shestakov Shestac92

🏠
Working from home
View GitHub Profile
@Shestac92
Shestac92 / dotMarketChart.java
Created February 10, 2020 03:05
dotMarketChart
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
Scatter scatter = AnyChart.scatter();
scatter.animation(true);
@Shestac92
Shestac92 / MainActivity.java
Created April 8, 2020 08:57
HeatMap with realtime update
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
final HeatMap riskMap = AnyChart.heatMap();
riskMap.interactivity().selectionMode(SelectionMode.NONE);
List<DataEntry> data = new ArrayList<>();
data.add(new HeatDataEntry("Rare", "Insignificant", 10));
data.add(new HeatDataEntry("Rare", "Minor", 8));
data.add(new HeatDataEntry("Rare", "Moderate", 7));
data.add(new HeatDataEntry("Unlikely", "Insignificant", 2));
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';
import {DemoDataProviderService} from '../demo-data-provider.service';
import {Subscription} from 'rxjs';
@Component({
selector: 'app-chart',
templateUrl: './chart.component.html',
styleUrls: ['./chart.component.css']
})
@Shestac92
Shestac92 / MainActivity.java
Created May 2, 2020 10:26
Bubble chart with custom series color
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
Scatter bubble = AnyChart.bubble();
bubble.animation(true);
bubble.title().enabled(true);
bubble.title().useHtml(true);
bubble.title()
.padding(0d, 0d, 10d, 0d)
@Shestac92
Shestac92 / activity.java
Created June 26, 2020 04:14
Treemap with negative values
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
final TreeMap treeMap = AnyChart.treeMap();
List<DataEntry> data = new ArrayList<>();
data.add(new CustomTreeDataEntry("Parent", null));
data.add(new CustomTreeDataEntry("A", "Parent", 692000, 692000));
data.add(new CustomTreeDataEntry("B", "Parent", 597000, 597000));
data.add(new CustomTreeDataEntry("Dairy", "Parent", 1359000, 1359000));
data.add(new CustomTreeDataEntry("Meat", "Parent", 596000, -596000));
@Shestac92
Shestac92 / MainActivity.java
Created June 29, 2020 03:28
Treemap chart with multiline labels
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
final TreeMap treeMap = AnyChart.treeMap();
List<DataEntry> data = new ArrayList<>();
data.add(new CustomTreeDataEntry("Parent", null));
data.add(new CustomTreeDataEntry("A", "Parent", 692000, 100, 200));
data.add(new CustomTreeDataEntry("B", "Parent", 597000, 100, 200));
data.add(new CustomTreeDataEntry("Dairy", "Parent", 1359000, 100, 200));
data.add(new CustomTreeDataEntry("Meat", "Parent", 596000, 100, 200));
@Shestac92
Shestac92 / MainActivity.java
Created June 30, 2020 06:12
Pie chart with custom palette
Pie pie = AnyChart.pie();
List<DataEntry> data = new ArrayList<>();
data.add(new ValueDataEntry("John", 10000));
data.add(new ValueDataEntry("Jake", 12000));
data.add(new ValueDataEntry("Peter", 18000));
String[] palette = {"red", "green", "orange", "blue"};
pie.palette(palette);
@Shestac92
Shestac92 / MainActivity.java
Created June 30, 2020 06:30
Pie chart with fill colors in the data
Pie pie = AnyChart.pie();
List<DataEntry> data = new ArrayList<>();
data.add(new CustomDataEntry("John", 10000, "red"));
data.add(new CustomDataEntry("Jake", 12000, "green"));
data.add(new CustomDataEntry("Peter", 18000, "blue"));
pie.data(data);
AnyChartView anyChartView = (AnyChartView) findViewById(R.id.any_chart_view);
@Shestac92
Shestac92 / MainActivity.java
Created August 6, 2020 10:46
Pie chart with individual coloring from data
Pie pie = AnyChart.pie();
List<DataEntry> data = new ArrayList<>();
data.add(new CustomDataEntry("John", 1222232.00, "red"));
data.add(new CustomDataEntry("Jake", 1222232.00, "green"));
data.add(new CustomDataEntry("Peter", 1222232.00, "blue"));
pie.data(data);
AnyChartView anyChartView = (AnyChartView) findViewById(R.id.any_chart_view);
@Shestac92
Shestac92 / MainActivity.java
Created August 6, 2020 10:54
Pie chart with conditional coloring via fill callback
Pie pie = AnyChart.pie();
List<DataEntry> data = new ArrayList<>();
data.add(new CustomDataEntry("A", 637166.0, 3.07));
data.add(new CustomDataEntry("B", 721630.0, -0.77));
data.add(new CustomDataEntry("C", 148662.0, 1.12));
data.add(new CustomDataEntry("D", 78662.0, -1.24));
data.add(new CustomDataEntry("E", 90000.0, 2.14));
pie.data(data);