AAChartModel/AAChartCore

范围视图在数据的min=max时,图表上显示空白,有什么办法显示点东西出来?

InnocentYang opened this issue · 3 comments

APP要显示每天的心率范围,现在有条数据,min=88, max=88,在图表中显示空白,有什么办法让它多少显示点什么东西出来?

image

    @Override
    protected AAChartModel getChartData(HealthChart healthChart) {
        List<HealthChartItem> healthChartItems = healthChart.getHealthCharts();
        int length = healthChartItems.size();
        Object[][] values = new Object[length][2];
        for (int i = 0; i < length; i++) {
            HealthChartItem healthChartItem = healthChartItems.get(i);
            int minValue = healthChartItem.getMinValue();
            int maxValue = healthChartItem.getMaxValue();
            values[i][0] = minValue;
            values[i][1] = maxValue;
        }

        AASeriesElement element = new AASeriesElement().name("")
                .dataLabels(new AADataLabels().color(AAColor.Red)
                        .borderColor(AAColor.Red)
                        .shape("callout")
                        .backgroundColor(AAColor.White))
                .type(AAChartType.Columnrange)
                .borderRadius(customBorderRadius())
                .borderWidth(customBorderWidth())
                .data(values);

        AASeriesElement[] aaSeriesArr = {element};
        return new AAChartModel()
                .categories(getXLabels())
                .chartType(AAChartType.Columnrange)
                .dataLabelsEnabled(false)
                .xAxisTickInterval(xAxisInterval())
                .tooltipValueSuffix(getString(R.string.times_per_minute))
                .legendEnabled(false)
                .touchEventEnabled(true)
                .markerSymbolStyle(AAChartSymbolStyleType.Normal)
                .series(aaSeriesArr);
    }

试试像这样配置

        AAOptions aaOptions = aaChartModel.aa_toAAOptions();

        aaOptions.plotOptions.series.minPointLength(5);
    public Number minPointLength; //柱状图, 条形图, 柱形范围图, 瀑布图, 箱线图(盒须图)直接设置单个图形元素的最小高度