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
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
Table table = Table.instantiate("x");
table.addData(getData());
TableMapping mapping = table.mapAs("{open: 'open', high: 'high', low: 'low', close: 'close'}");
Stock stock = AnyChart.stock();
Plot plot = stock.plot(0);
@Shestac92
Shestac92 / ViewController
Created November 25, 2021 10:28
ViewController with linear gauge
import UIKit
import AnyChartiOS
class ViewController: UIViewController {
@IBOutlet var anyChartView: AnyChartView!
override func viewDidLoad() {
super.viewDidLoad()
AnyChartView chart = findViewById(R.id.any_chart_view);
APIlib.getInstance().setActiveAnyChartView(chart);
Cartesian cartesian = AnyChart.line();
cartesian.animation(true);
cartesian.padding(10.0, 20.0, 5.0, 20.0);
cartesian.animation(true);
cartesian.crosshair().enabled(true);
cartesian.crosshair()
.yLabel(true)
.yStroke((Stroke) null, null, null, (String) null, (String) null);
@Shestac92
Shestac92 / MainActivity.java
Created March 10, 2021 05:38
Line chart with dateTime scale
AnyChartView chart = findViewById(R.id.any_chart_view);
APIlib.getInstance().setActiveAnyChartView(chart);
Cartesian lineChart = AnyChart.line();
List<DataEntry> list = new ArrayList<>();
list.add(new ValueDataEntry("1615354086157", 1));
list.add(new ValueDataEntry("1615354096157", 3));
list.add(new ValueDataEntry("1615354106157", 63));
list.add(new ValueDataEntry("1615354116157", 1326));
list.add(new ValueDataEntry("1615354126157", 2059));
list.add(new ValueDataEntry("1615354136157", 7598));
@Shestac92
Shestac92 / MainActivity.java
Created February 22, 2021 04:10
update chart title
final Pie pie = AnyChart.pie();
List<DataEntry> data = new ArrayList<>();
data.add(new ValueDataEntry("Apples", 6371664));
data.add(new ValueDataEntry("Pears", 789622));
data.add(new ValueDataEntry("Bananas", 7216301));
data.add(new ValueDataEntry("Grapes", 1486621));
data.add(new ValueDataEntry("Oranges", 1200000));
pie.title().enabled(true).text("Title text");
@Shestac92
Shestac92 / MainActivity.java
Created November 13, 2020 09:58
Line chart with adjusted yScale
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
Cartesian chart = AnyChart.line();
List<DataEntry> data = new ArrayList<>();
data.add(new ValueDataEntry("John", 10));
data.add(new ValueDataEntry("Jake", 12));
data.add(new ValueDataEntry("Peter", 18));
data.add(new ValueDataEntry("Mike", 14));
Column series = chart.column(data);
@Shestac92
Shestac92 / MainActivity.java
Created November 13, 2020 05:45
2 series Polar chart with individual coloring
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
Polar polar = AnyChart.polar();
List<DataEntry> data1 = new ArrayList<>();
data1.add(new CustomDataEntry("Nail polish", 12814, "blue"));
data1.add(new CustomDataEntry("Eyebrow pencil", 13012, "purple"));
data1.add(new CustomDataEntry("Rouge", 11624, "green"));
data1.add(new CustomDataEntry("Pomade", 8814, "blue"));
data1.add(new CustomDataEntry("Eyeshadows", 12998, "blue"));
[Table]:
LOAD
[name],
[value],
Date(Date#([start], 'D/M/YYYY') ) AS [start],
Date(Date#([finish], 'DD/M/YYYY') ) AS [finish];
LOAD * INLINE
[
name,value,start,finish
task_1,15,1/1/2020,10/3/2020
@Shestac92
Shestac92 / MainActivity.java
Created November 5, 2020 07:01
2x-Ordinal Cartesian chart
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
List<DataEntry> data = new ArrayList<>();
data.add(new CustomDataEntry("2020/05/23", "TripTone360"));
data.add(new CustomDataEntry("2025/05/23", "Trip"));
Cartesian chart = AnyChart.cartesian();
chart.xAxis(0).enabled(true);
chart.yAxis(0).enabled(true);
JumpLine series = chart.jumpLine(data);
@Shestac92
Shestac92 / MainActivity.java
Created September 24, 2020 06:05
Heatmap with linear color scale
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 CustomDataEntry("Rare", "Insignificant", 10.0));
data.add(new CustomDataEntry("Rare", "Minor", 8.12));
data.add(new CustomDataEntry("Rare", "Moderate", 7.34));
data.add(new CustomDataEntry("Unlikely", "Insignificant", 2.2134));