AAChartModel / AAChartCore

📈📊☕️☕️☕️An elegant modern declarative data visualization chart framework for Android. Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types.极其精美而又强大的 Android 数据可视化图表框架,支持柱状图、条形图、折线图、曲线图、折线填充图、曲线填充图、气泡图、扇形图、环形图、散点图、雷达图、混合图等各种类型的多达几十种的信息图图表,完全满足工作所需.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

InnocentYang opened this issue · 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);
    }
commented

试试像这样配置

        AAOptions aaOptions = aaChartModel.aa_toAAOptions();

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