From the below screenshot, it is difficult to figure out the plot band low and high value by looking at the chart.
Is it possible to add y-axis ticks for the plot bands high and low values ?
Code: Select all
HIChartView chartView = findViewById(R.id.chartview1);
HIOptions options = new HIOptions();
HIYAxis yAxis = new HIYAxis();
yAxis.setTitle(new HITitle());
yAxis.getTitle().setText("");
HIPlotBands plotBands = new HIPlotBands();
plotBands.setFrom(1);
plotBands.setTo(3);
yAxis.setPlotBands(new ArrayList<>(Arrays.asList(plotBands)));
yAxis.setTickPositioner(new HIFunction("function() { let positions = [], tick = this.dataMin; positions.push(tick); this.userOptions.plotBands.forEach(plotBand => { positions.push(plotBand.from); positions.push(plotBand.to); }); positions.sort(); return positions; }"));
options.setYAxis(new ArrayList<HIYAxis>(){{add(yAxis);}});
HISeries series = new HISeries();
series.setData(new ArrayList<>(Arrays.asList(4.2)));
options.setSeries(new ArrayList<>(Arrays.asList(series)));